]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
OK. It is much better to do it the cmake way...
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 29 Sep 2012 09:44:41 +0000 (09:44 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 29 Sep 2012 09:44:41 +0000 (09:44 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26882 0785d39b-7218-0410-832d-ea1e28bc413d

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
deal.II/config/Config.cmake.in

index c90523e043211a2339d95bf840b0ca3d9f0433ba..b3ed90c29f6d3351bedfd803ba418a0cee3eed33 100644 (file)
 
 MACRO(DEAL_II_INITIALIZE_CACHED_VARIABLES)
 
+  IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDE)
+    MESSAGE(FATAL_ERROR
+      "DEAL_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."
+      )
+  ENDIF()
+
   SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING
     "Choose the type of build, options are: Debug, Release"
     )
index 022df90310695ed287fedf28607111038d752b11..f4afcd78ee0c4fc858692ed306f7ad25d676f77c 100644 (file)
 
 MACRO(DEAL_II_SETUP_TARGET target)
 
+  IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDE)
+    MESSAGE(FATAL_ERROR
+      "DEAL_II_SETUP_TARGET can only be called in external projects after "
+      "the inclusion of deal.IIConfig.cmake. It is not intended for "
+      "internal use."
+      )
+  ENDIF()
+
   CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
 
   SET_TARGET_PROPERTIES(${target} PROPERTIES
@@ -30,28 +38,10 @@ MACRO(DEAL_II_SETUP_TARGET target)
       "${DEAL_II_USER_DEFINITIONS_RELEASE}"
     )
 
-  IF(NOT "${DEAL_II_LIBRARIES_DEBUG}${DEAL_II_EXTERNAL_LIBRARIES_DEBUG}" STREQUAL "")
-    TARGET_LINK_LIBRARIES(${target}
-      debug
-        ${DEAL_II_LIBRARIES_DEBUG}
-        ${DEAL_II_EXTERNAL_LIBRARIES_DEBUG}
-      )
-  ENDIF()
-
-  IF(NOT "${DEAL_II_LIBRARIES_RELEASE}${DEAL_II_EXTERNAL_LIBRARIES_RELEASE}" STREQUAL "")
-    TARGET_LINK_LIBRARIES(${target}
-      optimized
-        ${DEAL_II_LIBRARIES_RELEASE}
-        ${DEAL_II_EXTERNAL_LIBRARIES_RELEASE}
-      )
-  ENDIF()
-
-  IF(NOT "${DEAL_II_EXTERNAL_LIBRARIES}" STREQUAL "")
     TARGET_LINK_LIBRARIES(${target}
-      general
+        ${DEAL_II_LIBRARIES}
         ${DEAL_II_EXTERNAL_LIBRARIES}
       )
-  ENDIF()
 
 ENDMACRO()
 
index 3f2dfb7bbddd2f2b8e717c740f99fcea5f442dcd..cf3ee143166a0d2c3ae3ff7343506fd8a1828a95 100644 (file)
@@ -115,7 +115,7 @@ IF(CMAKE_BUILD_TYPE MATCHES "Debug")
     "${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}/${DEAL_II_LIBRARY_NAME_DEBUG}"
     )
   LIST(APPEND DEAL_II_LIBRARIES
-    DEBUG
+    debug
     "${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}/${DEAL_II_LIBRARY_NAME_DEBUG}"
     )
 
@@ -127,16 +127,13 @@ IF(CMAKE_BUILD_TYPE MATCHES "Release")
     "${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}/${DEAL_II_LIBRARY_NAME_RELEASE}"
     )
   LIST(APPEND DEAL_II_LIBRARIES
-    RELEASE
+    optimized
     "${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}/${DEAL_II_LIBRARY_NAME_RELEASE}"
     )
 
   LIST(APPEND DEAL_II_BUILD_TYPES "RELEASE")
 ENDIF()
 
-#
-# TODO: Remove this hack.
-#
 FOREACH(build ${DEAL_II_BUILD_TYPES})
   STRING(TOLOWER "${build}" build_lowercase)
   FILE(REMOVE
index 3da5233bed9566f86a55455089e93f5ed0e78e5f..72530c42d7d2178d56b23bf441a9569193de880b 100644 (file)
@@ -26,6 +26,33 @@ IF(DEAL_II_COMPONENT_PROJECT_CONFIG)
   # Configure and install the cmake project configuration:
   #
 
+  SET(CONFIG_EXTERNAL_LIBRARIES
+    general
+    ${DEAL_II_EXTERNAL_LIBRARIES}
+    )
+
+  IF(CMAKE_BUILD_TYPE MATCHES "Debug")
+    SET(CONFIG_EXTERNAL_LIBRARIES_DEBUG
+      ${DEAL_II_EXTERNAL_LIBRARIES}
+      ${DEAL_II_EXTERNAL_LIBRARIES_DEBUG}
+      )
+    LIST(APPEND CONFIG_LIBRARIES
+      debug
+      ${DEAL_II_EXTERNAL_LIBRARIES_DEBUG}
+      )
+  ENDIF()
+
+  IF(CMAKE_BUILD_TYPE MATCHES "Release")
+    SET(CONFIG_EXTERNAL_LIBRARIES_RELEASE
+      ${DEAL_II_EXTERNAL_LIBRARIES}
+      ${DEAL_II_EXTERNAL_LIBRARIES_RELEASE}
+      )
+    LIST(APPEND CONFIG_LIBRARIES
+      optimized
+      ${DEAL_II_EXTERNAL_LIBRARIES_RELEASE}
+      )
+  ENDIF()
+
   CONFIGURE_FILE(
     ${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
     ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
index a8a4298ff93cbde26294613d412ca4b976b151cb..e921c0d2ad7a6424c7449d0749e76c028fc0c106 100644 (file)
@@ -2,6 +2,8 @@
 # The deal.II project configuration file
 #
 
+SET(DEAL_II_PROJECT_CONFIG_INCLUDE TRUE)
+
 
 #
 # General information
@@ -57,11 +59,17 @@ SET(DEAL_II_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
 SET(DEAL_II_LINKER_FLAGS_DEBUG "${DEAL_II_SHARED_LINKER_FLAGS_DEBUG}")
 SET(DEAL_II_LINKER_FLAGS_RELEASE "${DEAL_II_SHARED_LINKER_FLAGS_RELEASE}")
 
+SET(DEAL_II_USER_DEFINITIONS "${DEAL_II_USER_DEFINITIONS}")
+SET(DEAL_II_USER_DEFINITIONS_DEBUG "${DEAL_II_USER_DEFINITIONS_DEBUG}")
+SET(DEAL_II_USER_DEFINITIONS_RELEASE "${DEAL_II_USER_DEFINITIONS_RELEASE}")
+
+
 #
-# Information on where to find the deal.II libraries and headers
+# Information about the the deal.II libraries and headers
 #
 
 SET(DEAL_II_INCLUDE_DIRS "${DEAL_II_INCLUDE_DIRS}")
+
 SET(DEAL_II_LIBRARIES "${DEAL_II_LIBRARIES}")
 SET(DEAL_II_LIBRARIES_DEBUG "${DEAL_II_LIBRARIES_DEBUG}")
 SET(DEAL_II_LIBRARIES_RELEASE "${DEAL_II_LIBRARIES_RELEASE}")
@@ -73,13 +81,9 @@ SET(DEAL_II_LIBRARIES_RELEASE "${DEAL_II_LIBRARIES_RELEASE}")
 
 SET(DEAL_II_EXTERNAL_INCLUDE_DIRS "${DEAL_II_USER_INCLUDE_DIRS}")
 
-SET(DEAL_II_EXTERNAL_LIBRARIES "${DEAL_II_EXTERNAL_LIBRARIES}")
-SET(DEAL_II_EXTERNAL_LIBRARIES_DEBUG "${DEAL_II_EXTERNAL_LIBRARIES_DEBUG}")
-SET(DEAL_II_EXTERNAL_LIBRARIES_RELEASE "${DEAL_II_EXTERNAL_LIBRARIES_RELEASE}")
-
-SET(DEAL_II_USER_DEFINITIONS "${DEAL_II_USER_DEFINITIONS}")
-SET(DEAL_II_USER_DEFINITIONS_DEBUG "${DEAL_II_USER_DEFINITIONS_DEBUG}")
-SET(DEAL_II_USER_DEFINITIONS_RELEASE "${DEAL_II_USER_DEFINITIONS_RELEASE}")
+SET(DEAL_II_EXTERNAL_LIBRARIES "${CONFIG_EXTERNAL_LIBRARIES}")
+SET(DEAL_II_EXTERNAL_LIBRARIES_DEBUG "${CONFIG_EXTERNAL_LIBRARIES_DEBUG}")
+SET(DEAL_II_EXTERNAL_LIBRARIES_RELEASE "${CONFIG_EXTERNAL_LIBRARIES_RELEASE}")
 
 
 #

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.