]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Cleanup and restructure
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 27 Jul 2013 12:12:34 +0000 (12:12 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 27 Jul 2013 12:12:34 +0000 (12:12 +0000)
git-svn-id: https://svn.dealii.org/trunk@30172 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/CMakeLists.txt
deal.II/cmake/setup_cached_variables.cmake
deal.II/cmake/setup_deal_ii.cmake
deal.II/cmake/setup_finalize.cmake
deal.II/cmake/setup_post_project_call.cmake [new file with mode: 0644]

index 04dba539c696ceb060503a5d8e6d5094a214a21c..45d1ad2964e6d095c20da6769aacfb20178cb5fd 100644 (file)
@@ -72,6 +72,8 @@ PROJECT(deal.II CXX)
 ENABLE_LANGUAGE_OPTIONAL(C)
 ENABLE_LANGUAGE_OPTIONAL(Fortran)
 
+INCLUDE(setup_post_project_call)
+
 INCLUDE(setup_deal_ii)
 INCLUDE(setup_compiler_flags)
 
index e8667e17c112c9ed1fe5c66061a79c5294002e0a..7260738c672a7063919e00344b8d2a303b8a213b 100644 (file)
@@ -142,7 +142,7 @@ ENDIF()
 
 
 OPTION(DEAL_II_ALLOW_PLATFORM_INTROSPECTION
-  "Allow platform introspection for CPU command set, SSE and AVX"
+  "Allow platform introspection for CPU command sets, SSE and AVX"
   ON
   )
 MARK_AS_ADVANCED(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
@@ -201,7 +201,6 @@ OPTION(DEAL_II_WITH_64BIT_INDICES
   )
 
 
-
 #
 # Tell the user very prominently, that we're doing things differently w.r.t
 # CMAKE_(C|CXX)_FLAGS_(DEBUG|RELEASE)
@@ -213,6 +212,7 @@ FOREACH(_flag
   SHARED_LINKER_FLAGS_DEBUG
   )
   IF(NOT "${CMAKE_${_flag}}" STREQUAL "")
+    UNSET(${CMAKE_${_flag}} CACHE)
     MESSAGE(FATAL_ERROR
       "\nThe deal.II cmake build system does not use CMAKE_${_flag}.\n"
       "Use DEAL_II_${_flag}, instead!\n\n"
@@ -220,6 +220,7 @@ FOREACH(_flag
   ENDIF()
 ENDFOREACH()
 
+
 #
 # Hide all unused compiler flag variables:
 #
@@ -246,6 +247,7 @@ FOREACH(_flag
   SET(${_flag} "" CACHE INTERNAL "" FORCE)
 ENDFOREACH()
 
+
 #
 # Set cached compiler flags to an empty string:
 #
index 931bf618f37b6ec91cff891645806c1c5b78b99e..b9078a241ef4a702e979a243b76f09f1749123b6 100644 (file)
@@ -51,8 +51,6 @@
 #     DEAL_II_PROJECT_CONFIG_RELDIR   *)
 #
 #     DEAL_II_BUILD_TYPES
-#     DEAL_II_WITH_BUNDLED_DIRECTORY
-#     DEAL_II_WITH_DOC_DIRECTORY
 #
 # *)  Can be overwritten by the command line via -D<...>
 #
@@ -146,49 +144,3 @@ IF(CMAKE_BUILD_TYPE MATCHES "Release")
   LIST(APPEND DEAL_II_BUILD_TYPES "RELEASE")
 ENDIF()
 
-
-########################################################################
-#                                                                      #
-#   Cleanup and setup that has to happen after the call to PROJECT():  #
-#                                                                      #
-########################################################################
-
-#
-# Cleanup some files used for storing the names of all object targets that
-# 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 into a global scope...)
-#
-FOREACH(_build ${DEAL_II_BUILD_TYPES})
-  STRING(TOLOWER "${_build}" _build_lowercase)
-  FILE(REMOVE
-    ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${_build_lowercase}
-    )
-ENDFOREACH()
-
-IF(DEAL_II_PREFER_STATIC_LIBS)
-  #
-  # Invert the search order for libraries when DEAL_II_PREFER_STATIC_LIBS
-  # is set. This will prefer static archives instead of shared libraries:
-  #
-  # TODO: Does this work on a Windows or CYGWIN target?
-  LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
-ENDIF()
-
-#
-# Cross compilation stuff:
-#
-IF(CMAKE_CROSSCOMPILING)
-  #
-  # Disable platform introspection when cross compiling
-  #
-  SET(DEAL_II_ALLOW_PLATFORM_INTROSPECTION OFF CACHE BOOL "" FORCE)
-
-  #
-  # Import native expand_instantiations for use in cross compilation:
-  #
-  SET(DEAL_II_NATIVE "DEAL_II_NATIVE-NOTFOUND" CACHE FILEPATH
-    "A pointer to a native deal.Ii build directory"
-    )
-  INCLUDE(${DEAL_II_NATIVE}/cmake/scripts/importExecutables.cmake)
-ENDIF()
index e2f919a30944e71da64ecfa2648e472807f629c5..c530dc2cb35ca1a56ae7885d62fff0e84f3e55b6 100644 (file)
@@ -60,6 +60,19 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES})
   ENDIF()
 ENDFOREACH()
 
+#
+# Cleanup some files used for storing the names of all object targets that
+# 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 into a global scope...)
+#
+FOREACH(_build ${DEAL_II_BUILD_TYPES})
+  STRING(TOLOWER "${_build}" _build_lowercase)
+  FILE(REMOVE
+    ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${_build_lowercase}
+    )
+ENDFOREACH()
+
 
 ########################################################################
 #                                                                      #
diff --git a/deal.II/cmake/setup_post_project_call.cmake b/deal.II/cmake/setup_post_project_call.cmake
new file mode 100644 (file)
index 0000000..690acf5
--- /dev/null
@@ -0,0 +1,53 @@
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+
+########################################################################
+#                                                                      #
+#         Setup that has to happen after the call to PROJECT():        #
+#                                                                      #
+########################################################################
+
+#
+# Library search order:
+#
+IF(DEAL_II_PREFER_STATIC_LIBS)
+  #
+  # Invert the search order for libraries when DEAL_II_PREFER_STATIC_LIBS
+  # is set. This will prefer static archives instead of shared libraries:
+  #
+  # TODO: Does this work on a Windows or CYGWIN target?
+  LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
+ENDIF()
+
+
+#
+# Cross compilation stuff:
+#
+IF(CMAKE_CROSSCOMPILING)
+  #
+  # Disable platform introspection when cross compiling
+  #
+  SET(DEAL_II_ALLOW_PLATFORM_INTROSPECTION OFF CACHE BOOL "" FORCE)
+
+  #
+  # Import native expand_instantiations for use in cross compilation:
+  #
+  SET(DEAL_II_NATIVE "DEAL_II_NATIVE-NOTFOUND" CACHE FILEPATH
+    "A pointer to a native deal.Ii build directory"
+    )
+  INCLUDE(${DEAL_II_NATIVE}/cmake/scripts/importExecutables.cmake)
+ENDIF()

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.