From: maier Date: Fri, 5 Oct 2012 16:01:37 +0000 (+0000) Subject: Bugfixes X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aba3fcec7600e0e9e75d8e0775c54982919befb7;p=dealii-svn.git Bugfixes git-svn-id: https://svn.dealii.org/branches/branch_cmake@26967 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/cmake/macros/macro_deal_ii_import_library_targets.cmake b/deal.II/cmake/macros/macro_deal_ii_import_library_targets.cmake index 7e7b64a0f8..57ae09782d 100644 --- a/deal.II/cmake/macros/macro_deal_ii_import_library_targets.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_import_library_targets.cmake @@ -29,23 +29,17 @@ MACRO(DEAL_II_IMPORT_LIBRARY) IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDED) MESSAGE(FATAL_ERROR - "DEAL_II_SETUP_TARGET can only be called in external projects after " + "\nDEAL_II_SETUP_TARGET can only be called in external projects after " "the inclusion of deal.IIConfig.cmake. It is not intended for " - "internal use." + "internal use.\n\n" ) ENDIF() INCLUDE(${DEAL_II_TARGET_CONFIG}) # - # Fixup the CONFIGURATION types for debug and release targets: + # Setup a ${DEAL_II_BASE_NAME} target and populate it with our # - FOREACH(build ${DEAL_II_BUILD_TYPES}) - SET_TARGET_PROPERTIES(${DEAL_II_TARGET_${build}} - PROPERTIES - MAP_IMPORTED_CONFIG ${build} - ) - ENDFOREACH() ENDMACRO() diff --git a/deal.II/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake b/deal.II/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake index 40c1d32d20..7f9ab0245d 100644 --- a/deal.II/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake @@ -29,9 +29,9 @@ MACRO(DEAL_II_INITIALIZE_CACHED_VARIABLES) IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDED) MESSAGE(FATAL_ERROR - "DEAL_II_INITIALIZE_CACHED_VARIABLES can only be called in external " + "\nDEAL_II_INITIALIZE_CACHED_VARIABLES can only be called in external " "projects after the inclusion of deal.IIConfig.cmake. It is not " - "intended for internal use." + "intended for internal use.\n\n" ) ENDIF() diff --git a/deal.II/cmake/macros/macro_deal_ii_setup_target.cmake b/deal.II/cmake/macros/macro_deal_ii_setup_target.cmake index 009ab4fd6e..d2249371c1 100644 --- a/deal.II/cmake/macros/macro_deal_ii_setup_target.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_setup_target.cmake @@ -20,7 +20,7 @@ # DEAL_II_SETUP_TARGET(target) # # This sets the necessary include directories, linker flags, compile -# definitions and the external libraries the target will be linked against. +# definitions and the deal.II library the target will be linked against. # # @@ -28,9 +28,9 @@ MACRO(DEAL_II_SETUP_TARGET target) IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDED) MESSAGE(FATAL_ERROR - "DEAL_II_SETUP_TARGET can only be called in external projects after " + "\nDEAL_II_SETUP_TARGET can only be called in external projects after " "the inclusion of deal.IIConfig.cmake. It is not intended for " - "internal use." + "internal use.\n\n" ) ENDIF() @@ -46,21 +46,35 @@ MACRO(DEAL_II_SETUP_TARGET target) "${DEAL_II_USER_DEFINITIONS}" ) - # TODO: A bit more magic... + # + # Set build type dependend flags and definitions: + # FOREACH(build ${DEAL_II_BUILD_TYPES}) - IF(CMAKE_BUILD_TYPE MATCHES "${build}") - SET_TARGET_PROPERTIES(${target} PROPERTIES - LINK_FLAGS_${CMAKE_BUILD_TYPE} - "${DEAL_II_LINKER_FLAGS_${build}}" - COMPILE_DEFINITIONS_${CMAKE_BUILD_TYPE} - "${DEAL_II_USER_DEFINITIONS_${build}}" - ) - TARGET_LINK_LIBRARIES(${target} - ${DEAL_II_TARGET_${build}} - ) - RETURN() - ENDIF() + SET_TARGET_PROPERTIES(${target} PROPERTIES + LINK_FLAGS_${build} + "${DEAL_II_LINKER_FLAGS_${build}}" + COMPILE_DEFINITIONS_${build} + "${DEAL_II_USER_DEFINITIONS_${build}}" + ) + ENDFOREACH() + # + # Link againgst the correct deal.II library target for the current + # CMAKE_BUILD_TYPE: + # + STRING(TOUPPER "${CMAKE_BUILD_TYPE}" build) + IF(NOT "${DEAL_II_TARGET_${build}}" STREQUAL "") + TARGET_LINK_LIBRARIES(${target} + ${DEAL_II_TARGET_${build}} + ) + ELSE() + MESSAGE(FATAL_ERROR + "\nNo matching deal.II library target for current build type: " + "\"${CMAKE_BUILD_TYPE}\"\n" + "Candidates are (case insensitive): ${DEAL_II_BUILD_TYPES}\n\n" + ) + ENDIF() + ENDMACRO() diff --git a/deal.II/cmake/setup_deal_ii.cmake b/deal.II/cmake/setup_deal_ii.cmake index 7714db339c..bff486cbbd 100644 --- a/deal.II/cmake/setup_deal_ii.cmake +++ b/deal.II/cmake/setup_deal_ii.cmake @@ -160,7 +160,7 @@ SET(DEAL_II_PROJECT_CONFIG_NAME "${DEAL_II_PACKAGE_NAME}") SET_IF_EMPTY(DEAL_II_BASE_NAME "deal_II") SET_IF_EMPTY(DEAL_II_DEBUG_SUFFIX ".g") -SET_IF_EMPTY(DEAL_II_RELEASE_SUFFIX "") +SET_IF_EMPTY(DEAL_II_RELEASE_SUFFIX ".o") SET(DEAL_II_PATH ${CMAKE_INSTALL_PREFIX}) diff --git a/deal.II/config/CMakeLists.txt b/deal.II/config/CMakeLists.txt index a0f4a035e1..f77b192c54 100644 --- a/deal.II/config/CMakeLists.txt +++ b/deal.II/config/CMakeLists.txt @@ -62,7 +62,7 @@ FOREACH(build ${DEAL_II_BUILD_TYPES}) ENDFOREACH() # -# Append the feature configuration: +# Append feature configuration: # FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake "\n\n#\n# Feature configuration:\n#\n\n" @@ -77,8 +77,7 @@ FOREACH(var ${res}) ENDFOREACH() # -# Include the convenience macros directly at the end of our project -# config: +# Include convenience macros directly at the end of our project config: # FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake "\n\n#\n# Include some convenience macros directly in the project config:\n#\n\n"