#
# Load all macros:
#
-FILE(GLOB macro_files "cmake/macros/*.cmake")
-FOREACH(file ${macro_files})
- MESSAGE(STATUS "Include ${file}")
- INCLUDE(${file})
+FILE(GLOB _macro_files "cmake/macros/*.cmake")
+FOREACH(_file ${_macro_files})
+ MESSAGE(STATUS "Include ${_file}")
+ INCLUDE(${_file})
ENDFOREACH()
INCLUDE(setup_external_macros)
#
# Run all system checks:
#
-FILE(GLOB check_files "cmake/checks/*.cmake")
-FOREACH(file ${check_files})
- MESSAGE(STATUS "Include ${file}")
- INCLUDE(${file})
+FILE(GLOB _check_files "cmake/checks/*.cmake")
+FOREACH(_file ${_check_files})
+ MESSAGE(STATUS "Include ${_file}")
+ INCLUDE(${_file})
ENDFOREACH()
#
#
# Feature configuration:
#
-FILE(GLOB configure_files "cmake/configure/configure_*.cmake")
+FILE(GLOB _configure_files "cmake/configure/configure_*.cmake")
# Make sure the configure_*.cmake files are included in alphabetical order
# to fullfill some dependencies...
-LIST(SORT configure_files)
-FOREACH(file ${configure_files})
- MESSAGE(STATUS "Include ${file}")
- INCLUDE(${file})
+LIST(SORT _configure_files)
+FOREACH(_file ${_configure_files})
+ MESSAGE(STATUS "Include ${_file}")
+ INCLUDE(${_file})
ENDFOREACH()
#
# See if there is a compiler flag to enable C++11 features
#
IF(NOT DEFINED DEAL_II_HAVE_CXX11_FLAG)
- FOREACH(test_flag
+ FOREACH(_test_flag
"-std=c++11"
"-std=c++0x"
)
- CHECK_CXX_COMPILER_FLAG("${test_flag}" DEAL_II_HAVE_CXX11_FLAG)
+ CHECK_CXX_COMPILER_FLAG("${_test_flag}" DEAL_II_HAVE_CXX11_FLAG)
IF(DEAL_II_HAVE_CXX11_FLAG)
# We have found a CXX11_FLAG that the compiler understands
- SET(DEAL_II_CXX11_FLAG "${test_flag}" CACHE INTERNAL "")
+ SET(DEAL_II_CXX11_FLAG "${_test_flag}" CACHE INTERNAL "")
BREAK()
ELSE()
# Remove test result from cache and try the next flag in the list
ADD_FLAGS(CMAKE_CXX_FLAGS "${DEAL_II_CXX11_FLAG}")
ELSE()
-
MESSAGE(STATUS "Insufficient C++11 support. Disabling ${DEAL_II_CXX11_FLAG}.")
-
ENDIF()
SET(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
- FOREACH(func ${DEAL_II_LAPACK_FUNCTIONS})
- STRING(TOUPPER ${func} func_uppercase)
- CHECK_FUNCTION_EXISTS(${func} HAVE_${func_uppercase})
+ FOREACH(_func ${DEAL_II_LAPACK_FUNCTIONS})
+ STRING(TOUPPER ${_func} _func_uppercase)
+ CHECK_FUNCTION_EXISTS(${_func} HAVE_${_func_uppercase})
ENDFOREACH()
SET(CMAKE_REQUIRED_LIBRARIES)
MACRO(RESET_LAPACK_FUNCTIONS_CACHE)
- FOREACH(func ${DEAL_II_LAPACK_FUNCTIONS})
- STRING(TOUPPER ${func} func_uppercase)
- UNSET(HAVE_${func_uppercase} CACHE)
+ FOREACH(_func ${DEAL_II_LAPACK_FUNCTIONS})
+ STRING(TOUPPER ${_func} _func_uppercase)
+ UNSET(HAVE_${_func_uppercase} CACHE)
ENDFOREACH()
ENDMACRO()
"Check whether the found trilinos package contains all required modules:"
)
- SET(macro_modules_list amesos epetra ifpack aztecoo sacado teuchos)
- FOREACH(macro_module ${macro_modules_list})
- LIST_CONTAINS(macro_module_found ${macro_module} ${Trilinos_LIBRARIES})
- IF(macro_module_found)
- MESSAGE(STATUS "Found ${macro_module}")
+ FOREACH(_module
+ amesos epetra ifpack aztecoo sacado teuchos
+ )
+ LIST_CONTAINS(_module_found ${_module} ${Trilinos_LIBRARIES})
+ IF(_module_found)
+ MESSAGE(STATUS "Found ${_module}")
ELSE()
- MESSAGE(STATUS "Module ${macro_module} not found!")
- SET(macro_modules_missing "${macro_modules_missing} ${macro_module}")
+ MESSAGE(STATUS "Module ${_module} not found!")
+ SET(_modules_missing "${_modules_missing} ${_module}")
SET(${var} FALSE)
ENDIF()
ENDFOREACH()
MESSAGE(WARNING "\n"
"The Trilinos installation is missing one or more modules necessary for\n"
"the deal.II Trilinos interfaces:\n"
- "${macro_modules_missing}\n\n"
+ "${_modules_missing}\n\n"
"Please re-install Trilinos with the missing Trilinos subpackages enabled.\n\n"
)
ENDIF()
# be necessary to search for blacs, too. So we do this in a very
# probabilistic way...
#
-FOREACH(lib blacs blacsCinit blacsF77init)
- STRING(TOUPPER "${lib}" lib_upper)
- FIND_LIBRARY(${lib_upper}_LIBRARY
- NAMES ${lib} ${lib}_MPI-LINUX-0
+FOREACH(_lib blacs blacsCinit blacsF77init)
+ STRING(TOUPPER "${_lib}" _lib_upper)
+ FIND_LIBRARY(${_lib_upper}_LIBRARY
+ NAMES ${_lib} ${_lib}_MPI-LINUX-0
+ HINTS
${BLACS_DIR}
${SCALAPACK_DIR}
${SCALAPACK_DIR}/../blacs/
PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib LIB
)
- IF(NOT ${lib_upper}_LIBRARY MATCHES "-NOTFOUND")
+ IF(NOT ${_lib_upper}_LIBRARY MATCHES "-NOTFOUND")
LIST(APPEND SCLAPACK_LIBRARIES
- ${${lib_upper}_LIBRARY}
+ ${${_lib_upper}_LIBRARY}
)
ENDIF()
ENDFOREACH()
# exports a list with short names...
# So we check again for every lib and store the full path:
#
-FOREACH(library ${Trilinos_LIBRARIES})
- FIND_LIBRARY(TRILINOS_LIBRARY_${library}
- NAMES ${library}
+FOREACH(_library ${Trilinos_LIBRARIES})
+ FIND_LIBRARY(TRILINOS_LIBRARY_${_library}
+ NAMES ${_library}
HINTS ${Trilinos_LIBRARY_DIRS}
NO_DEFAULT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_CMAKE_FIND_ROOT_PATH
)
- LIST(APPEND TRILINOS_LIBRARIES ${TRILINOS_LIBRARY_${library}})
+ LIST(APPEND TRILINOS_LIBRARIES ${TRILINOS_LIBRARY_${_library}})
#
# Remove the variables from the cache, so that updating TRILINOS_DIR will
# find the new libraries..
#
- UNSET(TRILINOS_LIBRARY_${library} CACHE)
+ UNSET(TRILINOS_LIBRARY_${_library} CACHE)
ENDFOREACH()
SET(CMAKE_BUILD_TYPE
"DebugRelease"
CACHE STRING
- "Choose the type of build, options are: Debug, Release and DebugRelease.")
+ "Choose the type of build, options are: Debug, Release and DebugRelease."
+ )
#
# Tell the user very prominently, that we're doing things differently w.r.t
# CMAKE_(C|CXX)_FLAGS_(DEBUG|RELEASE)
#
-SET(flags C_FLAGS_RELEASE CXX_FLAGS_RELEASE C_FLAGS_DEBUG CXX_FLAGS_DEBUG)
-FOREACH(flag ${flags})
- IF(NOT "${CMAKE_${flag}}" STREQUAL "")
+FOREACH(_flag
+ C_FLAGS_RELEASE
+ CXX_FLAGS_RELEASE
+ C_FLAGS_DEBUG
+ CXX_FLAGS_DEBUG
+ )
+ IF(NOT "${CMAKE_${_flag}}" STREQUAL "")
MESSAGE(FATAL_ERROR
- "\nThe deal.II cmake build system does not use CMAKE_${flag}.\n"
- "Use DEAL_II_${flag}, instead!\n\n"
+ "\nThe deal.II cmake build system does not use CMAKE_${_flag}.\n"
+ "Use DEAL_II_${_flag}, instead!\n\n"
)
ENDIF()
ENDFOREACH()
#
# Hide all unused compiler flag variables:
#
-SET(flags
+FOREACH(_flag
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELWITHDEBINFO
)
-FOREACH(flag ${flags})
#
# Go away...
#
- SET(${flag} "" CACHE INTERNAL "" FORCE)
+ SET(${_flag} "" CACHE INTERNAL "" FORCE)
ENDFOREACH()
#
# Set cached compiler flags to an empty string:
#
-SET(deal_ii_used_flags
+SET(DEAL_II_USED_FLAGS
CMAKE_C_FLAGS
CMAKE_CXX_FLAGS
CMAKE_SHARED_LINKER_FLAGS
DEAL_II_CXX_FLAGS_RELEASE
DEAL_II_SHARED_LINKER_FLAGS_RELEASE
)
-FOREACH(flag ${deal_ii_used_flags})
+
+FOREACH(_flag ${DEAL_II_USED_FLAGS})
#
# "CACHE" ensures that we only set the variable if it is not already set
# as a cached variable. Effectively we're setting a default value:
#
- SET(${flag} "${${flag}}" CACHE STRING
- "The user supplied cache variable will be appended _at the end_ of the auto generated ${flag} variable"
+ SET(${_flag} "${${_flag}}" CACHE STRING
+ "The user supplied cache variable will be appended _at the end_ of the auto generated ${_flag} variable"
)
#
# setup_finalize.cmake (called at the end of the
# main CMakeLists.txt file).
#
- SET(${flag}_SAVED "${${flag}}")
- SET(${flag} "")
+ SET(${_flag}_SAVED "${${_flag}}")
+ SET(${_flag} "")
#
# Mark these flags as advanced.
#
- MARK_AS_ADVANCED(${flag})
+ MARK_AS_ADVANCED(${_flag})
ENDFOREACH()
#
# Setup for ICC (version >= 10) compiler:
#
- IF( CMAKE_CXX_COMPILER_ID MATCHES "Intel" )
+ IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
INCLUDE(setup_compiler_flags_intel)
SET(DEAL_II_KNOWN_COMPILER TRUE)
ENDIF()
ADD_CUSTOM_TARGET(library)
-FOREACH(build ${DEAL_II_BUILD_TYPES})
- ADD_DEPENDENCIES(library ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX})
- IF(build MATCHES "RELEASE")
+FOREACH(_build ${DEAL_II_BUILD_TYPES})
+ ADD_DEPENDENCIES(library ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX})
+ IF(_build MATCHES "RELEASE")
ADD_CUSTOM_TARGET(optimized
- DEPENDS ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
+ DEPENDS ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}
)
- ELSEIF(build MATCHES "DEBUG")
+ ELSEIF(_build MATCHES "DEBUG")
ADD_CUSTOM_TARGET(debug
- DEPENDS ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
+ DEPENDS ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}
)
ENDIF()
ENDFOREACH()
# will be bundled to the deal.II library. (Right now, i.e. cmake 2.8.8,
# this is the only reliable way to get information in a global scope...)
#
-FOREACH(build ${DEAL_II_BUILD_TYPES})
- STRING(TOLOWER "${build}" build_lowercase)
+FOREACH(_build ${DEAL_II_BUILD_TYPES})
+ STRING(TOLOWER "${_build}" _build_lowercase)
FILE(REMOVE
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${build_lowercase}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${_build_lowercase}
)
ENDFOREACH()
# ${flags}, see setup_cached_compiler_flags.cmake and the main
# CMakeLists.txt for details.
#
-FOREACH(flags ${deal_ii_used_flags})
- SET(${flags} "${${flags}} ${${flags}_SAVED}")
+FOREACH(_flags ${DEAL_II_USED_FLAGS})
+ SET(${_flags} "${${_flags}} ${${_flags}_SAVED}")
#
# Strip leading and trailing whitespace:
#
- # STRING(STRIP "${flags}" flags)
- STRING(STRIP "${${flags}}" ${flags})
+ STRING(STRIP "${${_flags}}" ${_flags})
ENDFOREACH()
LIST(REMOVE_DUPLICATES DEAL_II_EXTERNAL_LIBRARIES)
LIST(REVERSE DEAL_II_EXTERNAL_LIBRARIES)
ENDIF()
-FOREACH(build ${DEAL_II_BUILD_TYPES})
- IF(NOT "${DEAL_II_EXTERNAL_LIBRARIES_${build}}" STREQUAL "")
- LIST(REVERSE DEAL_II_EXTERNAL_LIBRARIES_${build})
- LIST(REMOVE_DUPLICATES DEAL_II_EXTERNAL_LIBRARIES_${build})
- LIST(REVERSE DEAL_II_EXTERNAL_LIBRARIES_${build})
+FOREACH(_build ${DEAL_II_BUILD_TYPES})
+ IF(NOT "${DEAL_II_EXTERNAL_LIBRARIES_${_build}}" STREQUAL "")
+ LIST(REVERSE DEAL_II_EXTERNAL_LIBRARIES_${_build})
+ LIST(REMOVE_DUPLICATES DEAL_II_EXTERNAL_LIBRARIES_${_build})
+ LIST(REVERSE DEAL_II_EXTERNAL_LIBRARIES_${_build})
ENDIF()
ENDFOREACH()
#
# And write a nice configuration summary to file:
#
-SET(log "${CMAKE_BINARY_DIR}/summary.log")
+SET(_log "${CMAKE_BINARY_DIR}/summary.log")
-FILE(WRITE ${log}
+FILE(WRITE ${_log}
"* * * *
* * deal.II configuration: * *
* * * *\n
CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}\n"
)
IF(CMAKE_BUILD_TYPE MATCHES "Release")
- FILE(APPEND ${log} " DEAL_II_CXX_FLAGS_RELEASE: ${DEAL_II_CXX_FLAGS_RELEASE}\n")
+ FILE(APPEND ${_log} " DEAL_II_CXX_FLAGS_RELEASE: ${DEAL_II_CXX_FLAGS_RELEASE}\n")
ENDIF()
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
- FILE(APPEND ${log} " DEAL_II_CXX_FLAGS_DEBUG: ${DEAL_II_CXX_FLAGS_DEBUG}\n")
+ FILE(APPEND ${_log} " DEAL_II_CXX_FLAGS_DEBUG: ${DEAL_II_CXX_FLAGS_DEBUG}\n")
ENDIF()
-FILE(APPEND ${log} " CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}\n")
+FILE(APPEND ${_log} " CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}\n")
IF(CMAKE_BUILD_TYPE MATCHES "Release")
- FILE(APPEND ${log} " DEAL_II_SHARED_LINKER_FLAGS_RELEASE: ${DEAL_II_SHARED_LINKER_FLAGS_RELEASE}\n")
+ FILE(APPEND ${_log} " DEAL_II_SHARED_LINKER_FLAGS_RELEASE: ${DEAL_II_SHARED_LINKER_FLAGS_RELEASE}\n")
ENDIF()
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
- FILE(APPEND ${log} " DEAL_II_SHARED_LINKER_FLAGS_DEBUG: ${DEAL_II_SHARED_LINKER_FLAGS_DEBUG}\n")
+ FILE(APPEND ${_log} " DEAL_II_SHARED_LINKER_FLAGS_DEBUG: ${DEAL_II_SHARED_LINKER_FLAGS_DEBUG}\n")
ENDIF()
IF(FEATURE_UMFPACK_BUNDLED_CONFIGURED)
- FILE(APPEND ${log}
+ FILE(APPEND ${_log}
"\nThe bundled UMFPACK library will be compiled with the following C compiler:
CMAKE_C_COMPILER: ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}
${CMAKE_C_COMPILER}
CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}\n"
)
IF(CMAKE_BUILD_TYPE MATCHES "Release")
- FILE(APPEND ${log} " DEAL_II_C_FLAGS_RELEASE: ${DEAL_II_C_FLAGS_RELEASE}\n")
+ FILE(APPEND ${_log} " DEAL_II_C_FLAGS_RELEASE: ${DEAL_II_C_FLAGS_RELEASE}\n")
ENDIF()
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
- FILE(APPEND ${log} " DEAL_II_C_FLAGS_DEBUG: ${DEAL_II_C_FLAGS_DEBUG}\n")
+ FILE(APPEND ${_log} " DEAL_II_C_FLAGS_DEBUG: ${DEAL_II_C_FLAGS_DEBUG}\n")
ENDIF()
ENDIF()
IF(NOT DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
- FILE(APPEND ${log} "\nWARNING: DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS is set to OFF\n")
+ FILE(APPEND ${_log} "\nWARNING: DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS is set to OFF\n")
ELSEIF(NOT DEAL_II_KNOWN_COMPILER)
- FILE(APPEND ${log} "\nWARNING: Unknown compiler! Please set compiler flags by hand.\n")
+ FILE(APPEND ${_log} "\nWARNING: Unknown compiler! Please set compiler flags by hand.\n")
ENDIF()
-FILE(APPEND ${log}
+FILE(APPEND ${_log}
"\nConfigured Features ("
)
IF(FORCE_AUTODETECTION)
- FILE(APPEND ${log}
+ FILE(APPEND ${_log}
"!!! FORCE_AUTODETECTION !!!, "
)
ENDIF()
IF(DISABLE_AUTODETECTION)
- FILE(APPEND ${log}
+ FILE(APPEND ${_log}
"!!! DISABLE_AUTODETECTION !!!, "
)
ENDIF()
-FILE(APPEND ${log}
+FILE(APPEND ${_log}
"DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED}):\n"
)
-GET_CMAKE_PROPERTY(res VARIABLES)
-FOREACH(var ${res})
- IF(var MATCHES "DEAL_II_WITH")
- IF(${${var}})
+GET_CMAKE_PROPERTY(_res VARIABLES)
+FOREACH(_var ${_res})
+ IF(_var MATCHES "DEAL_II_WITH")
+ IF(${${_var}})
# FEATURE is enabled
- STRING(REGEX REPLACE "^DEAL_II_WITH_" "" feature ${var})
+ STRING(REGEX REPLACE "^DEAL_II_WITH_" "" feature ${_var})
IF(FEATURE_${feature}_EXTERNAL_CONFIGURED)
- FILE(APPEND ${log} " ${var} set up with external dependencies\n")
+ FILE(APPEND ${_log} " ${_var} set up with external dependencies\n")
ELSEIF(FEATURE_${feature}_BUNDLED_CONFIGURED)
IF(DEAL_II_FORCE_BUNDLED_${feature})
- FILE(APPEND ${log} " ${var} set up with bundled packages (forced)\n")
+ FILE(APPEND ${_log} " ${_var} set up with bundled packages (forced)\n")
ELSE()
- FILE(APPEND ${log} " ${var} set up with bundled packages\n")
+ FILE(APPEND ${_log} " ${_var} set up with bundled packages\n")
ENDIF()
ENDIF()
ELSE()
# FEATURE is disabled
- FILE(APPEND ${log} " ( ${var} = ${${var}} )\n")
+ FILE(APPEND ${_log} " ( ${_var} = ${${_var}} )\n")
ENDIF()
ENDIF()
ENDFOREACH()
-FILE(APPEND ${log}
+FILE(APPEND ${_log}
"\nComponent configuration:\n"
)
-FOREACH(var ${res})
- IF(var MATCHES "DEAL_II_COMPONENT")
- IF(${${var}})
- FILE(APPEND ${log} " ${var}\n")
+FOREACH(_var ${_res})
+ IF(_var MATCHES "DEAL_II_COMPONENT")
+ IF(${${_var}})
+ FILE(APPEND ${_log} " ${_var}\n")
ELSE()
- FILE(APPEND ${log} " ( ${var} = ${${var}} )\n")
+ FILE(APPEND ${_log} " ( ${_var} = ${${_var}} )\n")
ENDIF()
ENDIF()
ENDFOREACH()
-FILE(READ ${log} DEAL_II_LOG_SUMMARY)
+FILE(READ ${_log} DEAL_II_LOG_SUMMARY)
MESSAGE("\n\n${DEAL_II_LOG_SUMMARY}\n")