]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Bugfixes
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 5 Oct 2012 16:01:37 +0000 (16:01 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 5 Oct 2012 16:01:37 +0000 (16:01 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26967 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/macros/macro_deal_ii_import_library_targets.cmake
deal.II/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake
deal.II/cmake/macros/macro_deal_ii_setup_target.cmake
deal.II/cmake/setup_deal_ii.cmake
deal.II/config/CMakeLists.txt

index 7e7b64a0f8b6087e46348366bbbde689ebb10aa8..57ae09782dc777599cf0bf9c4a301f09d9ccc50a 100644 (file)
@@ -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()
 
index 40c1d32d2051b9646aa477aa8d3c7f5df127cad8..7f9ab0245d97836d414abd8b958183706a576c1e 100644 (file)
@@ -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()
 
index 009ab4fd6ef3d5c3e50255635d085db32f4c3dd0..d2249371c1df72fb6bdbef3f09e2ef095d8c1d9e 100644 (file)
@@ -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()
 
index 7714db339cac2d4979c5908830386e839f83da9a..bff486cbbddea86cd742861e869e8787ec766c4d 100644 (file)
@@ -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})
 
index a0f4a035e1a1e7890abbd9fc2c0cbc0535493e52..f77b192c54f9185bbd43a7ce4ecb198e2de3e47d 100644 (file)
@@ -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"

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.