]> https://gitweb.dealii.org/ - dealii.git/commitdiff
address JP's comments 7395/head
authorMatthias Maier <tamiko@43-1.org>
Thu, 15 Nov 2018 17:13:43 +0000 (11:13 -0600)
committerMatthias Maier <tamiko@43-1.org>
Thu, 15 Nov 2018 17:29:07 +0000 (11:29 -0600)
cmake/config/CMakeLists.txt
cmake/config/config_base.pc.in [deleted file]
cmake/config/config_debug.pc.in
cmake/config/config_release.pc.in

index 3f1bc237809599d9deeec01c1ea313fc97ac0255..e16d77a111dfdddc6fa453fc5cf4c0ad52457a1f 100644 (file)
@@ -231,13 +231,12 @@ ENDFOREACH()
 #
 # Set up the pkgconfig configuration files consisting of
 #
-#   deal.II_base       # common part to all the rest
-#   deal.II_debug      # generated when buildtype is debug
-#   deal.II_release    # generated when buildtype is release
+#   deal.II_debug      # for the debug variant of the library
+#   deal.II_release    # for the release variant of the library
 #
-# We support two configurations out of which deal.II can be used - directly
-# from the build directory or after installation. So we have to prepare
-# two distinct setups.
+# Similarly to the CMake project configuration, we provide pkgconfig files
+# directly for the build directory, as well as for the final installation.
+# So we have to prepare two distinct setups.
 #
 # pkgconfig looks for *.pc files in an environmental variable called
 # PKG_CONFIG_PATH. So, to use the library in the build directory issue
@@ -256,8 +255,8 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES})
 
   SET(_name "${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}")
 
-  SET(CONFIG_RPATH_${_build}_PC "")
-  SET(CONFIG_LIBRARIES_${_build}_PC "-l${_name}")
+  SET(CONFIG_RPATH_${_build}_PC "\\\${libdir}")
+  SET(CONFIG_LIBRARIES_${_build}_PC "-L\${libdir} -l${_name}")
 
   FOREACH(_lib ${DEAL_II_LIBRARIES_${_build}} ${DEAL_II_LIBRARIES})
 
@@ -275,7 +274,7 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES})
       # Only append a library directory if it is new ...
       #
 
-      list (FIND CONFIG_RPATH_${_build}_PC "${_dir}" _index)
+      LIST(FIND CONFIG_RPATH_${_build}_PC "${_dir}" _index)
       IF (${_index} EQUAL -1)
         SET(_library_string "-L${_dir} ")
         LIST(APPEND CONFIG_RPATH_${_build}_PC ${_dir})
@@ -331,12 +330,6 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES})
     )
 ENDFOREACH()
 
-CONFIGURE_FILE(
-  ${CMAKE_CURRENT_SOURCE_DIR}/config_base.pc.in
-  ${_config_directory}/${DEAL_II_PROJECT_CONFIG_NAME}_base.pc
-  @ONLY
-  )
-
 #
 # For installation:
 #
@@ -352,6 +345,20 @@ TO_STRING_AND_ADD_PREFIX(CONFIG_INCLUDE_DIRS_PC "-I"
 FOREACH(_build ${DEAL_II_BUILD_TYPES})
   STRING(TOLOWER ${_build} _build_lowercase)
 
+  #
+  # Only populate the pkgconf files for the install directory if
+  # CMAKE_INSTALL_RPATH_USE_LINK_PATH is true.
+  #
+  # We use this a heuristic for now to decide whether the user actually
+  # wants to have RPATHs in configuration files after installation.
+  #
+  # FIXME: Unify RPATH handling between cmake and pkgconf configuration and
+  # clearly document RPATH behavior.
+  #
+  IF(NOT CMAKE_INSTALL_RPATH_USE_LINK_PATH)
+    SET(CONFIG_RPATH_${_build}_PC "")
+  ENDIF()
+
   CONFIGURE_FILE(
     ${CMAKE_CURRENT_SOURCE_DIR}/config_${_build_lowercase}.pc.in
     ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}_${_build_lowercase}.pc
@@ -364,19 +371,8 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES})
     )
 ENDFOREACH()
 
-CONFIGURE_FILE(
-  ${CMAKE_CURRENT_SOURCE_DIR}/config_base.pc.in
-  ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}_base.pc
-  @ONLY
-  )
-INSTALL(FILES
-  ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}_base.pc
-  DESTINATION ${DEAL_II_PKGCONF_RELDIR}
-  COMPONENT library
-  )
-
 #
-# Jobs done.
+# Job's done.
 #
 
 MESSAGE(STATUS "Setting up project configuration - Done")
diff --git a/cmake/config/config_base.pc.in b/cmake/config/config_base.pc.in
deleted file mode 100644 (file)
index aa87b27..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-prefix=@CONFIG_PATH_PC@
-includedir=${prefix}/@DEAL_II_INCLUDE_RELDIR@
-libdir=${prefix}/@DEAL_II_LIBRARY_RELDIR@
-
-Name: deal.II_base
-Description: base file used by the debug and release versions
-Version: @DEAL_II_VERSION@
-URL: https://github.com/dealii/dealii
-Cflags: @DEAL_II_CXX_FLAGS@ @CONFIG_INCLUDE_DIRS_PC@
-Libs: @DEAL_II_LINKER_FLAGS@ -L${libdir} -Wl,-rpath,${libdir}
index 0cd2b153d503c230b20951b71cecfbe1dade3f8b..5ea03885cd14de032d49901de8405a7212ae4b0c 100644 (file)
@@ -1,7 +1,11 @@
-Name: deal.II compiled in debug mode
+prefix=@CONFIG_PATH_PC@
+includedir=${prefix}/@DEAL_II_INCLUDE_RELDIR@
+libdir=${prefix}/@DEAL_II_LIBRARY_RELDIR@
+
+Name: deal.II debug variant
 Description: A C++ software library supporting the creation of finite element codes and an open community of users and developers.
 Version: @DEAL_II_VERSION@
-URL: https://github.com/dealii/dealii
-Requires: deal.II_base
-Cflags: @DEAL_II_CXX_FLAGS_DEBUG@
-Libs: @DEAL_II_LINKER_FLAGS_DEBUG@  @CONFIG_LIBRARIES_DEBUG_PC@ @CONFIG_RPATH_DEBUG_PC@
+URL: https://dealii.org/
+
+Cflags: @DEAL_II_CXX_FLAGS@ @DEAL_II_CXX_FLAGS_DEBUG@ @CONFIG_INCLUDE_DIRS_PC@
+Libs: @DEAL_II_LINKER_FLAGS@ @DEAL_II_LINKER_FLAGS_DEBUG@ @CONFIG_LIBRARIES_DEBUG_PC@ @CONFIG_RPATH_DEBUG_PC@
index 208e5e0556c5136911b614aaacb542021df44e90..726a35d040e1101fb5fa892c2d613e57bb8b4dca 100644 (file)
@@ -1,7 +1,11 @@
-Name: deal.II compiled in debug mode
+prefix=@CONFIG_PATH_PC@
+includedir=${prefix}/@DEAL_II_INCLUDE_RELDIR@
+libdir=${prefix}/@DEAL_II_LIBRARY_RELDIR@
+
+Name: deal.II release variant
 Description: A C++ software library supporting the creation of finite element codes and an open community of users and developers.
 Version: @DEAL_II_VERSION@
-URL: https://github.com/dealii/dealii
-Requires: deal.II_base
-Cflags: @DEAL_II_CXX_FLAGS_RELEASE@
-Libs: @DEAL_II_LINKER_FLAGS_RELEASE@  @CONFIG_LIBRARIES_RELEASE_PC@ @CONFIG_RPATH_RELEASE_PC@
+URL: https://dealii.org/
+
+Cflags: @DEAL_II_CXX_FLAGS@ @DEAL_II_CXX_FLAGS_RELEASE@ @CONFIG_INCLUDE_DIRS_PC@
+Libs: @DEAL_II_LINKER_FLAGS@ @DEAL_II_LINKER_FLAGS_RELEASE@ @CONFIG_LIBRARIES_RELEASE_PC@ @CONFIG_RPATH_RELEASE_PC@

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.