]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Some more documentation and code cleanup
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 23 Mar 2013 23:57:16 +0000 (23:57 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 23 Mar 2013 23:57:16 +0000 (23:57 +0000)
git-svn-id: https://svn.dealii.org/trunk@28999 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/configure/configure_1_lapack.cmake
deal.II/cmake/configure/configure_boost.cmake
deal.II/cmake/macros/macro_split_debug_release.cmake [new file with mode: 0644]
deal.II/doc/development/Config.sample

index 773885df399964d061325124a23e9e21c4bc9ac3..fb4ff6e4af807bfd3abab997a11358f0d9676552 100644 (file)
@@ -70,9 +70,7 @@ ENDMACRO()
 
 MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL)
   ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}")
-
   LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${LAPACK_LIBRARIES})
-
   CHECK_FOR_LAPACK_FUNCTIONS()
 ENDMACRO()
 
index b5cbc1e6ae777db8e06a76d5b234feeaafec00af..b295d8304474fc80eae91a40abef4337e4e97e9b 100644 (file)
@@ -52,22 +52,20 @@ ENDMACRO()
 
 
 MACRO(FEATURE_BOOST_CONFIGURE_EXTERNAL)
-  INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
+  INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS})
+
+  #
+  # Transform  Boost_LIBRARIES into a list of debug and release libraries
+  # without keywords:
+  #
+  SPLIT_DEBUG_RELEASE(_boost_debug _boost_release ${Boost_LIBRARIES})
 
   IF (CMAKE_BUILD_TYPE MATCHES "Debug")
-    LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG
-      ${Boost_SERIALIZATION_LIBRARY_DEBUG}
-      ${Boost_SYSTEM_LIBRARY_DEBUG}
-      ${Boost_THREAD_LIBRARY_DEBUG}
-      )
+    LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG ${_boost_debug})
   ENDIF()
 
   IF (CMAKE_BUILD_TYPE MATCHES "Release")
-    LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_RELEASE
-      ${Boost_SERIALIZATION_LIBRARY_RELEASE}
-      ${Boost_SYSTEM_LIBRARY_RELEASE}
-      ${Boost_THREAD_LIBRARY_RELEASE}
-      )
+    LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_RELEASE ${_boost_release})
   ENDIF()
 ENDMACRO()
 
diff --git a/deal.II/cmake/macros/macro_split_debug_release.cmake b/deal.II/cmake/macros/macro_split_debug_release.cmake
new file mode 100644 (file)
index 0000000..c39c5fb
--- /dev/null
@@ -0,0 +1,53 @@
+#####
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## <TODO: Full License information>
+## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
+## version of the LGPL license.
+##
+## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
+##
+#####
+
+
+#
+# A small macro to split a list of libraries with debug, optimized and
+# general keywords into two lists consisting of all libraries necessary for
+# the debug and release target only. If no keyword is given "optimized" is
+# assumed.
+#
+# Usage:
+#     SPLIT_DEBUG_RELEASE(list_debug list_release <...list of libraries...>)
+#
+#
+
+MACRO(SPLIT_DEBUG_RELEASE _list_debug _list_release)
+
+  SET(_toggle "optimized")
+  FOREACH(_tmp ${ARGN})
+    IF("${_tmp}" STREQUAL "debug" OR
+       "${_tmp}" STREQUAL "optimized" OR
+       "${_tmp}" STREQUAL "general")
+      SET(_toggle "${_tmp}")
+    ELSE()
+      IF("${_toggle}" STREQUAL "general")
+        LIST(APPEND ${_list_debug} "${_tmp}")
+        LIST(APPEND ${_list_release} "${_tmp}")
+      ELSEIF("${_toggle}" STREQUAL "debug")
+        LIST(APPEND ${_list_debug} "${_tmp}")
+      ELSEIF("${_toggle}" STREQUAL "optimized")
+        LIST(APPEND ${_list_release} "${_tmp}")
+      ENDIF()
+    ENDIF()
+  ENDFOREACH()
+
+  IF("${${_list_debug}}" STREQUAL "")
+    SET(${_list_debug} ${${_list_release}})
+  ELSEIF("${${_list_release}}" STREQUAL "")
+    SET(${_list_release} ${${_list_debug}})
+  ENDIF()
+
+ENDMACRO()
index a3f61ef7b8d4e73079fbc3714131cb8a350259ba..c264cc55924b02b87685a9d49ced5c747da111e4 100644 (file)
 #
 # Boost is a mandatory build time dependency.
 #
-# TODO
+# Automatic detection:
+#
+# SET(Boost_DIR "..." CACHE PATH
+#   "The preferred installation prefix for searching for boost"
+#   )
+#
+# Have a look at the very long configuration list in FindBoost.cmake.
+#
+# Manual setup:
+#
+# SET(Boost_FOUND TRUE CACHE BOOL "")
+# SET(Boost_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
+# SET(Boost_LIBRARIES "libraries;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
 #
 
 
 #
 # SET(MPI_CXX_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
 # SET(MPI_CXX_INCLUDE_PATH "include directory for mpi" CACHE STRING "")
-# SET(MPI_CXX_FLAGS "..." CACHE STRING "")
+# SET(MPI_CXX_COMPILE_FLAGS "..." CACHE STRING "")
 # SET(MPI_CXX_LINK_FLAGS "..." CACHE STRING "")
 #
 

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.