Commit a08be7e4 authored by Praetorius, Simon's avatar Praetorius, Simon
parents 25e5d9e2 f8cc0645
---
image: mathiwr/amdis-base:debian9
cache:
key: "$CI_BUILD_REF_NAME"
untracked: true
paths:
- install/boost
- install/petsc
- install/
stages:
- build
- demo
- test
before_script:
- tools/install_boost.sh
- tools/install_petsc.sh
# compile amdis
build:9-debug-gcc:
stage: build
image: duneci/base:9
script:
- tools/build_amdis.sh Debug
- tools/build_amdis.sh --stage build --config Debug
only:
- master
build:9-release-gcc:
stage: build
image: duneci/base:9
script:
- tools/build_amdis.sh Release
- tools/build_amdis.sh --stage build --config Release
only:
- master
build:9-parallel-debug-gcc:
stage: build
image: duneci/base:9
script:
- tools/build_parallel_amdis.sh Debug
- tools/build_amdis.sh --stage build --config Debug --parallel
only:
- master
build:9-parallel-release-gcc:
stage: build
image: duneci/base:9
script:
- tools/build_parallel_amdis.sh Release
- tools/build_amdis.sh --stage build --config Release --parallel
only:
- master
# compile the demos
demo:9-debug-gcc:
stage: demo
script:
- tools/build_amdis.sh --stage demo --config Debug
dependencies:
- build:9-debug-gcc
only:
- master
demo:9-release-gcc:
stage: demo
script:
- tools/build_amdis.sh --stage demo --config Release
dependencies:
- build:9-release-gcc
only:
- master
demo:9-parallel-debug-gcc:
stage: demo
script:
- tools/build_amdis.sh --stage demo --config Debug --parallel
dependencies:
- build:9-parallel-debug-gcc
only:
- master
demo:9-parallel-release-gcc:
stage: demo
script:
- tools/build_amdis.sh --stage demo --config Release --parallel
dependencies:
- build:9-parallel-release-gcc
only:
- master
# compiel and run the tests
test:9-debug-gcc:
stage: test
script:
- tools/build_amdis.sh --stage test --config Debug
dependencies:
- build:9-debug-gcc
only:
- master
test:9-release-gcc:
stage: test
script:
- tools/build_amdis.sh --stage test --config Release
dependencies:
- build:9-release-gcc
only:
- master
test:9-parallel-debug-gcc:
stage: test
script:
- tools/build_amdis.sh --stage test --config Debug --parallel
dependencies:
- build:9-parallel-debug-gcc
only:
- master
test:9-parallel-release-gcc:
stage: test
script:
- tools/build_amdis.sh --stage test --config Release --parallel
dependencies:
- build:9-parallel-release-gcc
only:
- master
......@@ -2,9 +2,68 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(AMDiS)
if (${CMAKE_VERSION} VERSION_GREATER "3.2")
include(${AMDiS_SOURCE_DIR}/cmake3/CMakeLists.txt)
set(AMDiS_VERSION "1.1.0")
set(BASE_DIR ${AMDiS_SOURCE_DIR})
set(SOURCE_DIR ${BASE_DIR}/src)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif ()
# ------------------------------------------------------------------------------
# some options to control the build process
option(ENABLE_PARALLEL_DOMAIN "Use parallel domain decomposition" false)
option(ENABLE_UMFPACK "Enable support for the UMFPACK solver" true)
option(ENABLE_EXTENSIONS "Use extensions for AMDiS" false)
option(ENABLE_HYPRE "Use HYPRE AMG solver" false)
option(ENABLE_PNG "Use png reader/writer" false)
option(ENABLE_SEQ_PETSC "Use sequential PETSc solvers" false)
# enable/disable some more features
option(ENABLE_COMPRESSION "Use output compression for vtu and arh files" true)
mark_as_advanced(ENABLE_COMPRESSION)
option(ENABLE_REINIT "Compile reinit library" true)
mark_as_advanced(ENABLE_REINIT)
option(ENABLE_COMPOSITE_FEM "Compile compositeFEM library" true)
mark_as_advanced(ENABLE_COMPOSITE_FEM)
option(BUILD_SHARED_LIBS "Build all libraries as shared or static, default: shared" true)
mark_as_advanced(BUILD_SHARED_LIBS)
if (MSVC)
set(BUILD_SHARED_LIBS false)
mark_as_advanced(BUILD_SHARED_LIBS)
message(WARNING "Currently we can only build static libraries with Visual Studio")
endif (MSVC)
# parallel of sequential version
if (ENABLE_PARALLEL_DOMAIN)
set(POSTFIX "-p")
else ()
set(POSTFIX "-s")
endif ()
# ------------------------------------------------------------------------------
if (${CMAKE_VERSION} VERSION_LESS "3.2")
# Fallback to classical CMakeLists file
include(${AMDiS_SOURCE_DIR}/cmake/CMakeLists.txt)
else ()
include(${AMDiS_SOURCE_DIR}/cmake3/CMakeLists.txt)
endif ()
# ------------------------------------------------------------------------------
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
${AMDiS_BINARY_DIR}/AMDISConfigVersion.cmake
VERSION ${AMDiS_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES ${AMDiS_BINARY_DIR}/AMDISConfigVersion.cmake DESTINATION share/amdis/)
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
##
## # The following are required to submit to the CDash dashboard:
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "AMDiS")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=AMDiS")
set(CTEST_DROP_SITE_CDASH TRUE)
# set(CTEST_USE_LAUNCHERS 1)
\ No newline at end of file
<html>
<head>
<title> Using AMDiS with cmake </title>
<style type="text/css" >
.desc { background-color:#E0E0E0; margin-left:100px }
</style >
</head>
<body>
<h1> Using AMDiS with cmake </h1>
With this short page, I will show you, how to use the cmake buildsystem with AMDiS. The introduction consists of two main parts:
<ol>
<li> <a href="#compiling" > compiling and installing AMDiS with CMake </a ></li>
<li> <a href="#using" > using the cmake installed AMDiS in your project </a ></li>
<li> <a href="#faq" > some frequently asked questions </a ></li>
</ol>
<h2> <a name="compiling" > Compiling and installing AMDiS with CMake </a > </h2>
<h3> configure </h3>
There are 3 different configure tools for CMake:
<ul> <li> cmake (non interactive) </li>
<li> ccmake (interactive on command line) </li>
<li> cmake-gui (qt-based gui) </li></ul>
<p>I will use the cmake and ccmake. The autoconf/automake implementation was used directly inside the AMDiS source directory (i.e. the directory you get through svn). To use the CMake buildsystem, I recommend a different directory structure for building and compiling AMDiS. The script <a href="https://fusionforge.zih.tu-dresden.de/frs/download.php/34/getamdis_cmake.sh" >getamdis_cmake.sh</a>, which can be found on <a href="https://fusionforge.zih.tu-dresden.de" >https://fusionforge.zih.tu-dresden.de</a>, creates such a directory structure.</p>
Assume, you have AMDiS downloaded in the directory
<pre class="desc" >
${HOME}/work/ </pre>
, the AMDiS source directory is
<pre class="desc">
${HOME}/work/amdis/AMDiS </pre>
. To configure and compile AMDiS I recommend using out of source builds. This means, you should create a directory amdis_build
<pre class="desc">
mkdir ${HOME}/work/amdis_build </pre>
and do the remaining work from there.
<pre class="desc">
cd ${HOME}/work/amdis_build </pre>
The simplest configuration of AMDiS, i.e. without umfpack and parallelization, only sets the install destination to the directory "${HOME}/programs/". To do this, you have to call cmake with your install destination and the AMDiS source directory as commandline arguments
<pre class="desc" >
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/programs/ ../amdis/AMDiS</pre>
Compilation and installation is the same as with automake/autoconf:
<pre class="desc">
make && make install </pre >
The last command will install AMDiS to ${HOME}/programs
<h2> <a name="using" > Using the cmake installed AMDiS in your project </a > </h2>
A cmake-project consists of the source files and a file CMakeLists.txt, which contains a description of needed libraries, headers and programs. If you have a simple project with one program "fooProg", which have to compile only one source file "src/foo.cc", your CMakeLists.txt consist of the following lines:
<pre class="desc" >
project(projectName) <br>
cmake_minimum_required(VERSION 2.8)<br><br>
find_package(AMDIS REQUIRED)<br>
if(AMDIS_FOUND)<br>
include(${AMDIS_USE_FILE})<br>
add_executable(fooProg src/foo.cc)<br>
target_link_libraries(fooProg ${AMDIS_LIBRARIES})<br>
endif(AMDIS_FOUND)<br>
</pre >
The first two lines
<pre class="desc" >
project(projectName) <br>
cmake_minimum_required(VERSION 2.8)
</pre >
tell cmake the name of your project and that you whish to use only cmake versions newer than 2.8.<br>
The line
<pre class="desc" >
find_package(AMDIS REQUIRED)
</pre >
tells cmake, that you want to use AMDiS and it should complain if AMDiS was not found. CMake will print an error message, bu will not stop the execution! With the command
<pre class="desc" >
include(${AMDIS_USE_FILE})
</pre >
we read an AMDiS specific configuration file, which sets some compilerflags and adds the include directorys. The program is added with
<pre class="desc" >
add_executable(fooProg src/foo.cc)
</pre >
and we have to tell cmake, that we need the library amdis and each library amdis depends on. This is done with the command
<pre class="desc" >
target_link_libraries(fooProg ${AMDIS_LIBRARIES})
</pre >
If cmake does not find AMDiS, you have to set the variable AMDIS_DIR to the directory containing the file AMDiSConfig.cmake. This file resides in
<pre class="desc" >
${CMAKE_INSTALL_PREFIX}/share/amdis/
</pre >
where CMAKE_INSTALL_PREFIX is the directory you choose during installation of amdis.
<h2 > <a name="faq" > Frequently asked questions </a ></h2 >
<h3 > Boost </h3>
If you have different boost versions on your system and you do not want to use the standard version in /usr/lib and /usr/include, you should set the environment variable BOOST_ROOT to your boost-installation.
<h3 > I will not set the AMDIS_DIR in every project. </h3 >
If you always use the same AMDiS directory, you can add the directory to your PATH variable.
</body>
</html>
set(AMDIS_NEED_CXX11 @ENABLE_CXX11@)
set(AMDIS_NEED_UMFPACK @ENABLE_UMFPACK@)
set(AMDIS_NEED_COMPRESSION @ENABLE_COMPRESSION@)
set(AMDIS_NEED_EXTENSIONS @ENABLE_EXTENSIONS@)
set(AMDIS_NEED_BASE_PROBLEMS @ENABLE_BASE_PROBLEMS@)
set(AMDIS_NEED_REINIT @ENABLE_REINIT@)
set(AMDIS_NEED_COMPOSITE_FEM @ENABLE_COMPOSITE_FEM@)
set(AMDIS_NEED_ZOLTAN @ENABLE_ZOLTAN@)
set(AMDIS_NEED_BDDCML @ENABLE_BDDCML@)
set(AMDIS_NEED_HYPRE @ENABLE_HYPRE@)
set(AMDIS_NEED_PNG @ENABLE_PNG@)
set(AMDIS_NEED_SEQ_PETSC @ENABLE_SEQ_PETSC@)
set(BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
set(CMAKE_BUILD_TYPE @CMAKE_BUILD_TYPE@)
set(AMDIS_COMPILEFLAGS "")
set(AMDIS_INCLUDE_DIRS "")
set(AMDIS_LIBRARIES "")
if (AMDIS_NEED_CXX11)
enable_cxx11(AMDIS_NEED_CXX11 AMDIS_COMPILEFLAGS)
if (NOT AMDIS_NEED_CXX11)
message(FATAL_ERROR "AMDiS was compiled with c++11 support, but the current compiler does not support this feature!")
endif (NOT AMDIS_NEED_CXX11)
list(APPEND AMDIS_COMPILEFLAGS "-DHAS_CXX11=1")
else ()
list(APPEND AMDIS_COMPILEFLAGS "-DHAS_CXX11=0")
endif (AMDIS_NEED_CXX11)
# try to detect the AMDiS include directory
# -------------------------------------------
find_file(_AMDIS_H AMDiS.h PATHS ${AMDIS_DIR}/../../include/amdis/)
if (_AMDIS_H)
get_filename_component(AMDIS_INCLUDE_DIR ${_AMDIS_H} PATH CACHE)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR})
else ()
message(ERROR "Could not detect the AMDiS include directory. Please set the variable AMDIS_INCLUDE_DIR to the directory containing the AMDiS headers.")
endif ()
unset(_AMDIS_H CACHE)
# MTL4 libraries
# --------------------
enable_mtl4(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
# AMDiS base libraries
# --------------------
find_library(_AMDIS_LIB amdis${POSTFIX} PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_AMDIS_LIB)
list(APPEND AMDIS_LIBRARIES optimized ${_AMDIS_LIB} debug ${_AMDIS_LIB}d)
else ()
message(ERROR "Could not detect the AMDiS${POSTFIX} library. Please set the variable _AMDIS_LIB to the AMDiS${POSTFIX} library.")
endif ()
unset(_AMDIS_LIB CACHE)
# Boost libraries
# ---------------
if (NOT BOOST_ROOT)
set(BOOST_ROOT @BOOST_ROOT@)
endif (NOT BOOST_ROOT)
if (NOT BOOST_LIBRARYDIR)
set(BOOST_LIBRARYDIR @BOOST_LIBRARYDIR@)
endif (NOT BOOST_LIBRARYDIR)
enable_boost(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
# umfpack library
# --------------------
if (AMDIS_NEED_UMFPACK)
set(AMDIS_SuiteSparse_DIR @SuiteSparse_DIR@)
set(AMDIS_UMFPACK_INCLUDE_DIR @UMFPACK_INCLUDE_DIRS@)
set(AMDIS_UMFPACK_LIB_DIR ${AMDIS_UMFPACK_INCLUDE_DIR}/../include)
enable_umfpack(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
endif (AMDIS_NEED_UMFPACK)
# amdis extensions
# ----------------
if (AMDIS_NEED_EXTENSIONS)
find_library(_EXTENSIONS_LIB amdisextensions${POSTFIX} PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_EXTENSIONS_LIB)
list(APPEND AMDIS_INCLUDE_DIRS
${AMDIS_INCLUDE_DIR}/extensions
${AMDIS_INCLUDE_DIR}/extensions/nanoflann
${AMDIS_INCLUDE_DIR}/extensions/pugixml
${AMDIS_INCLUDE_DIR}/extensions/time)
list(APPEND AMDIS_COMPILEFLAGS "-DHAVE_EXTENSIONS=1")
list(APPEND AMDIS_LIBRARIES optimized ${_EXTENSIONS_LIB} debug ${_EXTENSIONS_LIB}d)
if (AMDIS_NEED_BASE_PROBLEMS)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/extensions/base_problems)
endif (AMDIS_NEED_BASE_PROBLEMS)
else ()
message(FATAL_ERROR "Extensions library not found")
endif ()
unset(_EXTENSIONS_LIB CACHE)
endif (AMDIS_NEED_EXTENSIONS)
# reinit library
# --------------
if (AMDIS_NEED_REINIT)
find_library(_REINIT_LIB amdisreinit${POSTFIX} PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_REINIT_LIB)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/reinit)
list(APPEND AMDIS_LIBRARIES optimized ${_REINIT_LIB} debug ${_REINIT_LIB}d)
else ()
message(FATAL_ERROR "Reinit library not found")
endif ()
unset(_REINIT_LIB CACHE)
endif (AMDIS_NEED_REINIT)
# compositeFEM library
# --------------------
if (AMDIS_NEED_COMPOSITE_FEM)
find_library(_COMPOSITE_FEM_LIB amdiscompositefem${POSTFIX} PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_COMPOSITE_FEM_LIB)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/compositeFEM)
list(APPEND AMDIS_LIBRARIES optimized ${_COMPOSITE_FEM_LIB} debug ${_COMPOSITE_FEM_LIB}d)
else ()
message(FATAL_ERROR "CompositeFEM library not found")
endif ()
unset(_COMPOSITE_FEM_LIB CACHE)
endif (AMDIS_NEED_COMPOSITE_FEM)
# muparser library
# --------------------
find_library(_MUPARSER_LIB muparser PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_MUPARSER_LIB)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/muparser)
list(APPEND AMDIS_LIBRARIES ${_MUPARSER_LIB})
else ()
message(ERROR "MuParser library not found")
endif ()
unset(_MUPARSER_LIB CACHE)
# Additional libraries
# ==================================================================================================
if (AMDIS_HAS_PARALLEL_DOMAIN)
enable_mpi(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
enable_petsc(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
list(APPEND AMDIS_COMPILEFLAGS "-DHAVE_PARALLEL_DOMAIN_AMDIS=1")
endif (AMDIS_HAS_PARALLEL_DOMAIN)
# Zoltan library
# --------------
if (AMDIS_NEED_ZOLTAN)
enable_zoltan(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
endif ()
# BDDCML library
# --------------
if (AMDIS_NEED_BDDCML)
enable_bddcml(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
endif ()
# Hypre library
# --------------
if (AMDIS_NEED_HYPRE)
enable_hypre(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
endif ()
# PNG library
# --------------
if (AMDIS_NEED_PNG)
enable_png(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
endif ()
# Sequential PETSc library
# --------------
if (AMDIS_NEED_SEQ_PETSC AND NOT AMDIS_HAS_PARALLEL_DOMAIN)
enable_mpi(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
enable_petsc(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
list(APPEND COMPILEFLAGS "-DHAVE_SEQ_PETSC=1")
endif ()
This diff is collapsed.
# globally add compile options and include directories
# globally add compile options and include directories
add_definitions(${AMDIS_COMPILEFLAGS})
include_directories(${AMDIS_INCLUDE_DIRS})
This diff is collapsed.
SET (CTEST_SOURCE_DIRECTORY @CMAKE_CURRENT_SOURCE_DIR@)
SET (CTEST_BINARY_DIRECTORY @CMAKE_CURRENT_BINARY_DIR@)
SET (CTEST_COMMAND "${CMAKE_CTEST_COMMAND}")
SET (CTEST_BUILD_COMMAND ${CTEST_BINARY_DIRECTORY}/myMake.sh)
set(CTEST_UPDATE_COMMAND ${CTEST_SOURCE_DIRECTORY}/MySvn.sh)
#set(CTEST_UPDATE_OPTIONS "--username studentiwr --password iwr_ws09")
set(CTEST_SITE @SITE@)
set(CTEST_BUILD_NAME @BUILDNAME@)
ctest_start(@CTEST_MODEL@)
ctest_build()
ctest_submit()
set(COMPILER_TEST_DIR ${CMAKE_BINARY_DIR}/CMakeFiles/compilerTest)
file(WRITE ${COMPILER_TEST_DIR}/CMakeLists.txt
"project(compilerTest)
cmake_minimum_required(VERSION 2.8)
add_definitions(-std=c++11)
# VARIADIC CLASS_TEMPLATES
add_executable(test_variadic_templ_class test_variadic_templ_class.cpp)
target_link_libraries(test_variadic_templ_class)
# VARIADIC FUNCTION TEMPLATES
add_executable(test_variadic_templ_fct test_variadic_templ_fct.cpp)
target_link_libraries(test_variadic_templ_fct)
# ALIAS TEMPLATES
add_executable(test_alias_templates test_alias_templates.cpp)
target_link_libraries(test_alias_templates)
# DECLTYPE
add_executable(test_decltype test_decltype.cpp)
target_link_libraries(test_decltype)
# AUTO SPECIFIER
add_executable(test_auto test_auto.cpp)
target_link_libraries(test_auto)
# CONSTEXPR
add_executable(test_constexpr test_constexpr.cpp)
target_link_libraries(test_constexpr)
# DELEGATING CONSTRUCTORS
add_executable(test_delegating_constructors test_delegating_constructors.cpp)
target_link_libraries(test_delegating_constructors)
# RANGE-BASED FOR LOOPS
add_executable(test_range_based_for test_range_based_for.cpp)
target_link_libraries(test_range_based_for)")
file(WRITE ${COMPILER_TEST_DIR}/test_variadic_templ_class.cpp
"template<class... Ts> struct A{}; int main(){A<int, double> a;}")
file(WRITE ${COMPILER_TEST_DIR}/test_variadic_templ_fct.cpp
"template<class... Ts> void foo(Ts... ts){}; int main(){foo(1, 2.0, 3.0f);}")
file(WRITE ${COMPILER_TEST_DIR}/test_alias_templates.cpp
"template<class T> struct A{}; template<class T> using B=A<T>; int main(){B<int> b;}")
file(WRITE ${COMPILER_TEST_DIR}/test_decltype.cpp
"int main(){decltype(1) a = 1;}")
file(WRITE ${COMPILER_TEST_DIR}/test_auto.cpp
"int main(){auto a = 1;}")
file(WRITE ${COMPILER_TEST_DIR}/test_constexpr.cpp
"constexpr int foo(){return 1;}; int main(){static constexpr int f = foo();}")
file(WRITE ${COMPILER_TEST_DIR}/test_delegating_constructors.cpp
"struct A{ A(){} A(int) : A(){} }; int main(){ A a(1);}")
file(WRITE ${COMPILER_TEST_DIR}/test_range_based_for.cpp
"int main(){ int vec[10]; for (int& elem : vec) { elem = 1; } }")
set(COMPILER_CXX11_FEATURES "")
try_compile(TEST_VARIADIC_TEMPL_CLASS ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_variadic_templ_class)
try_compile(TEST_VARIADIC_TEMPL_FCT ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_variadic_templ_fct)
if (TEST_VARIADIC_TEMPL_CLASS AND TEST_VARIADIC_TEMPL_FCT)
message("Compiler supports variadic class/ function templates")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_VARIADIC_TEMPLATES=1")
endif()
try_compile(TEST_ALIAS_TEMPLATES ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_alias_templates)
if (TEST_ALIAS_TEMPLATES)
message("Compiler supports alias-templates")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_ALIAS_TEMPLATES=1")
endif()
try_compile(TEST_DECLTYPE ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_decltype)
if (TEST_DECLTYPE)
message("Compiler supports decltype")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_DECLTYPE=1")
endif()
try_compile(TEST_AUTO_SPECIFIER ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_auto)
if (TEST_AUTO_SPECIFIER)
message("Compiler supports auto")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_AUTO=1")
endif()
try_compile(TEST_CONSTEXPR ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_constexpr)
if (TEST_CONSTEXPR)
message("Compiler supports constexpr")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_CONSTEXPR=1")
endif()
try_compile(TEST_DELEGATING_CONSTRUCTORS ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_delegating_constructors)
if (TEST_DELEGATING_CONSTRUCTORS)
message("Compiler supports delegating constructors")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_DELEGATING_CONSTRUCTORS=1")
endif()
try_compile(TEST_RANGED_BASED_FOR ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_range_based_for)
if (TEST_RANGED_BASED_FOR)
message("Compiler supports range-based for loops")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_RANGE_BASED_FOR=1")
endif()
\ No newline at end of file
# CorrectWindowsPaths - this module defines one macro
#
# CONVERT_CYGWIN_PATH( PATH )
# This uses the command cygpath (provided by cygwin) to convert
# unix-style paths into paths useable by cmake on windows
macro (CONVERT_CYGWIN_PATH _path)
if (WIN32)
EXECUTE_PROCESS(COMMAND cygpath.exe -m ${${_path}}
OUTPUT_VARIABLE ${_path})
string (STRIP ${${_path}} ${_path})
endif (WIN32)
endmacro (CONVERT_CYGWIN_PATH)
This diff is collapsed.
......@@ -21,7 +21,14 @@
# # Make temporary files, run programs, etc, to determine FOO_INCLUDES and FOO_LIBRARIES
# endif (NOT foo_current)
#
# MULTIPASS_SOURCE_RUNS (Name INCLUDES LIBRARIES SOURCE RUNS LANGUAGE)
# Always runs the given test, use this when you need to re-run tests
# because parent variables have made old cache entries stale. The LANGUAGE
# variable is either C or CXX indicating which compiler the test should
# use.
# MULTIPASS_C_SOURCE_RUNS (Name INCLUDES LIBRARIES SOURCE RUNS)
# DEPRECATED! This is only included for backwards compatability. Use
# the more general MULTIPASS_SOURCE_RUNS instead.
# Always runs the given test, use this when you need to re-run tests
# because parent variables have made old cache entries stale.
......@@ -39,7 +46,7 @@ macro (FIND_PACKAGE_MULTIPASS _name _current)
# The name of the stored value for the given state
set (_stored_var PACKAGE_MULTIPASS_${_NAME}_${_state})
if (NOT "${${_stored_var}}" STREQUAL "${${_NAME}_${_state}}")
set (_states_current "NO")
set (_states_current "NO")
endif (NOT "${${_stored_var}}" STREQUAL "${${_NAME}_${_state}}")
set (${_stored_var} "${${_NAME}_${_state}}" CACHE INTERNAL "Stored state for ${_name}." FORCE)
list (REMOVE_AT _args 0)
......@@ -61,7 +68,7 @@ macro (FIND_PACKAGE_MULTIPASS _name _current)
if (_cmd STREQUAL "DEPENDENTS")
list (REMOVE_AT _args 0)
foreach (dep ${_args})
set (${_NAME}_${dep} "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
set (${_NAME}_${dep} "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
endforeach (dep)
endif (_cmd STREQUAL "DEPENDENTS")
set (${_NAME}_FOUND "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)