]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move some code from source/ to cmake/config/. 18064/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 31 Jan 2025 16:45:52 +0000 (09:45 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 31 Jan 2025 23:38:57 +0000 (16:38 -0700)
CMakeLists.txt
cmake/config/CMakeLists.txt
source/CMakeLists.txt

index 1e74da92e5e6690ccef671d9a83e32a21beb2a34..6a5e3eb51b01c4e3ebcfc99bdce3e965d9f86681 100644 (file)
@@ -153,9 +153,18 @@ endif()
 if(DEAL_II_HAVE_BUNDLED_DIRECTORY)
   add_subdirectory(bundled)
 endif()
-add_subdirectory(source) # has to be included after bundled
 
-add_subdirectory(cmake/config) # has to be included after source
+# Now that we have collected information about the configuration
+# and the bundled directory, set up the compilation of the
+# library from the files in the source/ directory.
+add_subdirectory(source)
+
+# Then also set up installation and other targets.
+add_subdirectory(cmake/config)
+
+# Now also configure installation of the examples. This relies on
+# the correctly set up library, so needs to come after configuration
+# in source/ and cmake/config/
 add_subdirectory(examples)
 
 add_subdirectory(contrib/utilities)
index bd1aca2318a1aad2020890c5af1224493c5ffd63..5ad6b6ce1743012f5b078471584adfa270a94584 100644 (file)
@@ -13,7 +13,7 @@
 ## ------------------------------------------------------------------------
 
 #
-# This file sets up the project configuration consisting of
+# This file sets up the project installation and configuration consisting of
 #
 #   deal.IIConfig.cmake
 #   deal.IIVersionConfig.cmake
 # two distinct setups.
 #
 
+
+message(STATUS "Setting up library installation")
+
+set(_targets ${DEAL_II_TARGET_NAME})
+foreach(build ${DEAL_II_BUILD_TYPES})
+  string(TOLOWER ${build} build_lowercase)
+  list(APPEND _targets ${DEAL_II_TARGET_NAME}_${build_lowercase})
+endforeach()
+
+file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR})
+export(TARGETS ${_targets} ${DEAL_II_TARGETS} ${DEAL_II_TARGETS_DEBUG} ${DEAL_II_TARGETS_RELEASE}
+  NAMESPACE "${DEAL_II_TARGET_NAME}::"
+  FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake
+)
+
+install(TARGETS ${_targets} ${DEAL_II_TARGETS} ${DEAL_II_TARGETS_DEBUG} ${DEAL_II_TARGETS_RELEASE}
+  COMPONENT library
+  EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets
+  RUNTIME DESTINATION ${DEAL_II_EXECUTABLE_RELDIR}
+  LIBRARY DESTINATION ${DEAL_II_LIBRARY_RELDIR}
+  ARCHIVE DESTINATION ${DEAL_II_LIBRARY_RELDIR}
+  )
+
+install(EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets
+  NAMESPACE "${DEAL_II_TARGET_NAME}::"
+  DESTINATION ${DEAL_II_PROJECT_CONFIG_RELDIR}
+  COMPONENT library
+  )
+
+message(STATUS "Setting up library installation - Done")
+
+
 message(STATUS "Setting up project configuration")
 
 #
index b5e6afc0606db03f1057af3ef8eb7fa6b9ec83c8..a82416c08af0393621cdcdd74060c828a2e4baf9 100644 (file)
@@ -207,34 +207,4 @@ foreach(build ${DEAL_II_BUILD_TYPES})
     )
 endforeach()
 
-#
-# And install all targets:
-#
-
-set(_targets ${DEAL_II_TARGET_NAME})
-foreach(build ${DEAL_II_BUILD_TYPES})
-  string(TOLOWER ${build} build_lowercase)
-  list(APPEND _targets ${DEAL_II_TARGET_NAME}_${build_lowercase})
-endforeach()
-
-file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR})
-export(TARGETS ${_targets} ${DEAL_II_TARGETS} ${DEAL_II_TARGETS_DEBUG} ${DEAL_II_TARGETS_RELEASE}
-  NAMESPACE "${DEAL_II_TARGET_NAME}::"
-  FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake
-)
-
-install(TARGETS ${_targets} ${DEAL_II_TARGETS} ${DEAL_II_TARGETS_DEBUG} ${DEAL_II_TARGETS_RELEASE}
-  COMPONENT library
-  EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets
-  RUNTIME DESTINATION ${DEAL_II_EXECUTABLE_RELDIR}
-  LIBRARY DESTINATION ${DEAL_II_LIBRARY_RELDIR}
-  ARCHIVE DESTINATION ${DEAL_II_LIBRARY_RELDIR}
-  )
-
-install(EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets
-  NAMESPACE "${DEAL_II_TARGET_NAME}::"
-  DESTINATION ${DEAL_II_PROJECT_CONFIG_RELDIR}
-  COMPONENT library
-  )
-
 message(STATUS "Setting up library - Done")

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.