]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Simplify cross compilation stuff and documentation
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 26 Oct 2013 09:48:13 +0000 (09:48 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 26 Oct 2013 09:48:13 +0000 (09:48 +0000)
git-svn-id: https://svn.dealii.org/trunk@31433 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/macros/macro_expand_instantiations.cmake
deal.II/cmake/scripts/CMakeLists.txt
deal.II/cmake/setup_deal_ii.cmake
deal.II/doc/developers/porting.html
deal.II/doc/developers/testsuite.html

index 684860d475e7dd23ef09393fc39f4d3e1db37fb3..9574b0fab8777b3844d0491993a3a1ce0da4dc7e 100644 (file)
@@ -38,9 +38,14 @@ MACRO(EXPAND_INSTANTIATIONS _target _inst_in_files)
   FOREACH (_inst_in_file ${_inst_in_files})
     STRING(REGEX REPLACE "\\.in$" "" _inst_file "${_inst_in_file}" )
 
+    SET(_dependency)
+    IF(TARGET expand_instantiations)
+      SET(_dependency expand_instantiations)
+    ENDIF()
+
     ADD_CUSTOM_COMMAND(
       OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}
-      DEPENDS expand_instantiations
+      DEPENDS ${_dependency}
               ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/template-arguments
               ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file}
       COMMAND expand_instantiations
index 6e000ece9b064e13ba29326425a3ced122a1bf4a..6341917a7a47beb73f5552205c9f1fd7a48c38c1 100644 (file)
@@ -26,10 +26,6 @@ IF(NOT CMAKE_CROSSCOMPILING)
       COMPONENT compat_files
       )
   ENDIF()
-
-  EXPORT(TARGETS expand_instantiations
-    FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Executables.cmake
-    )
 ENDIF()
 
 IF(DEAL_II_COMPONENT_COMPAT_FILES)
@@ -96,8 +92,4 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES)
     DESTINATION ${DEAL_II_COMMON_RELDIR}/scripts
     COMPONENT compat_files
     )
-  EXPORT(TARGETS make_dependencies report_features
-    FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Executables.cmake
-    APPEND
-    )
 ENDIF()
index 0e5a93301b5e80ed51445b018b5e475a3fdafc91..777c066931d4dcddd88cbcc5a6eac4a14e7b3236 100644 (file)
@@ -141,30 +141,17 @@ ENDIF()
 #                                                                      #
 ########################################################################
 
-#
-# 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:
+  #
   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"
-    )
-  IF(DEAL_II_NATIVE MATCHES "-NOTFOUND")
-    MESSAGE(FATAL_ERROR
-      "Please set the CMake variable DEAL_II_NATIVE to a valid path that points to a native deal.II build directory"
-      )
-  ENDIF()
-  INCLUDE(${DEAL_II_NATIVE}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Executables.cmake)
 ENDIF()
index 89efdc866505143a14b0a51984a67e6145129c05..2408227120e0d64f4dd8145aa70f8bc8f2082da3 100644 (file)
       You have to set up a native deal.II build directory first and run
       <code>make expand_instantiations</code> in it. The executable is
       needed for the build system (and obviously the cross compiled version
-      cannot be used). Assuming you have a working cross compilation
-      toolchain, set up a <i>toolchain file</i> next. An example toolchain
-      file can be found <a href="Toolchain.sample">here</a>. With that
-      invoke <code>cmake</code> e.g. with:
+      cannot be used). Locate the <code>expand_instantions</code>
+      executable and export its location in the <code>PATH</code>
+      environment variable.
+    </p>
+
+    <p>
+      Assuming you have a working cross compilation toolchain, set up a
+      <a href="Toolchain.sample"><i>toolchain file</i></a> next. With that
+      invoke <code>cmake</code> with something like:
       <pre>
     cmake -DCMAKE_TOOLCHAIN_FILE=&lt;...&gt;/Toolchain.sample
-          -DDEAL_II_NATIVE=&lt;...&gt;/native/build/dir
-
           -DDEAL_II_FORCE_BUNDLED_BOOST=ON
           -DDEAL_II_ALLOW_AUTODETECTION=OFF
           ../deal.II
       </pre>
-      where <code>DEAL_II_NATIVE</code> points to the toolchain file and
-      <code>DEAL_II_NATIVE</code> to the native build directory (which
-      <code>expand_instantiations</code> will be picked from). The remaining
-      configuration can be adjusted at will, see <a
-        href="cmake.html">the documentation</a>.
+      where <code>CMAKE_TOOLCHAIN_FILE</code> points to the toolchain file.
+      The remaining configuration can be adjusted at will, see <a
+      href="cmake.html">the documentation</a>.
     </p>
 
     <hr />
index 9eb8dd343b78231ee47e6cdf376cd9ed86a51d72..9e0de43e32b9330949219b1fcf26bbdd2a1604b9 100644 (file)
       </pre>
     </p>
 
-    <p>
-      <b>Note:</b> Specifying these options via environment variables is
-      volatile, i.e. if <code>make setup_tests</code> is invoked a second
-      time without the variables set in environment, the option will be
-      reset to the default value. If you want to set these options
-      permanently, set them via cmake as CMake variable in the build
-      directory:
+    Alternatively, you can also set them as CMake variables when
+    configuring the build directory:
       <pre>
 
     $ cmake -DTEST_PICKUP_REGEX="&lt;regular expression&gt;" .
       </pre>
-      A variable set via cmake always <i>overrides</i> one
-      set via environment.
+      The variables will be passed down to the subprojects. A variable set
+      via cmake always <i>overrides</i> one set via environment.
+    </p>
+
+    <p>
+      <b>Note:</b> The subprojects cache these options (regardless of set
+      via environment variables or as cmake variable). So, if you want to
+      disable an option again, you have to explicitly set it to an empty
+      string. Furthermore, if you have set the option as a CMake variable
+      in the build directory configuration you have to overwrite it in the
+      build directory cache.
     </p>
 
     <a name="run"></a>

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.