From: Alberto Sartori Date: Wed, 31 Oct 2018 08:19:12 +0000 (+0100) Subject: first corrections X-Git-Tag: v9.1.0-rc1~551^2~8 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=309215ec19890554c62ad02dbf7d8539dbad2651;p=dealii.git first corrections --- diff --git a/cmake/config/CMakeLists.txt b/cmake/config/CMakeLists.txt index a232dd8995..5eb4b01e08 100644 --- a/cmake/config/CMakeLists.txt +++ b/cmake/config/CMakeLists.txt @@ -159,8 +159,6 @@ SET(CONFIG_INCLUDE_DIRS ${DEAL_II_USER_INCLUDE_DIRS} ) -SET(CONFIG_INCLUDE_DIRS_INSTALL_PC ${CONFIG_INCLUDE_DIRS}) # for pkgconfig - CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake @@ -225,9 +223,156 @@ FOREACH(_name ${_deal_ii_features_sorted}) ENDFOREACH() ENDFOREACH() -# just for mac and linux -if(NOT MSVC) - add_subdirectory(pkgconfig) -endif() +##################################################################### +# pkgconfig files +# +# 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 +# +# 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. +# +# pkgconfig looks for *.pc files in an environmental variable called +# PKG_CONFIG_PATH. So, to use the library in the build directory issue +# export PKG_CONFIG_PATH=/path/to/BUILD_DIR/lib/pkgconfig:$PKG_CONFIG_PATH +# +# To use the library in the installed location +# export PKG_CONFIG_PATH=/path/to/INSTALL_DIR/lib/pkgconfig:$PKG_CONFIG_PATH +# + +# +# For binary dir (AKA build dir): +# + +set(DEAL_II_PATH_PC ${CMAKE_BINARY_DIR}) + +set (CONFIG_INCLUDE_DIRS_PC "") +foreach(_dir ${CONFIG_INCLUDE_DIRS_BUILD_PC}) + string(CONCAT CONFIG_INCLUDE_DIRS_PC "${CONFIG_INCLUDE_DIRS_PC} -I${_dir} " ) +endforeach() + +# populate the variables +# CONFIG_LIBRARIES_DEBUG_PC +# CONFIG_LIBRARIES_RELEASE_PC + +foreach (_build ${DEAL_II_BUILD_TYPES}) + if(_build MATCHES DEBUG) + set(_build "debug") + else() + set(_build "release") + endif() + + string(TOUPPER ${_build} _B) + set(PC_LIBRARIES ${CONFIG_LIBRARIES_${_B}}) + set(CONFIG_LIBRARIES_PC "") + foreach(_s ${PC_LIBRARIES}) + # check if _s contains lib + # if _s is somethink like /path/to/trilinos/lib/libteuchos.so + # we have to add /path/to/trilinos/lib to the runpath + if(${_s} MATCHES "lib") + string(CONCAT CONFIG_LIBRARIES_PC " ${CONFIG_LIBRARIES_PC} ${_s} ") + + # work for the runpath + string(FIND ${_s} "/" _i REVERSE) + string(SUBSTRING ${_s} 0 ${_i} _p) + list(APPEND PC_RPATH ${_p}) + else() + # here _s is something like "m" for the libm.so so we add the -l flag + string(CONCAT CONFIG_LIBRARIES_PC " ${CONFIG_LIBRARIES_PC} -l${_s} " ) + endif() + endforeach() + + set(CONFIG_LIBRARIES_${_B}_PC ${CONFIG_LIBRARIES_PC}) + + list(REMOVE_DUPLICATES PC_RPATH) + foreach(_r ${PC_RPATH}) + string(CONCAT CONFIG_LIBRARIES_${_B}_PC " ${CONFIG_LIBRARIES_${_B}_PC} -Wl,-rpath,${_r} " ) + endforeach() + +endforeach() + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/deal.II_base.pc.in + ${CMAKE_BINARY_DIR}/${DEAL_II_LIBRARY_RELDIR}/pkgconfig/${DEAL_II_PROJECT_CONFIG_NAME}_base.pc + @ONLY + ) + +# generate the requested .pc files +foreach (_build ${DEAL_II_BUILD_TYPES}) + if(_build MATCHES DEBUG) + set(_build "debug") + else() + set(_build "release") + endif() + + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/deal.II_${_build}.pc.in + ${CMAKE_BINARY_DIR}/${DEAL_II_LIBRARY_RELDIR}/pkgconfig/${DEAL_II_PROJECT_CONFIG_NAME}_${_build}.pc + @ONLY + ) +endforeach() + +############################################################################# +# +# For installation: +# + +set(DEAL_II_PATH_PC ${CMAKE_INSTALL_PREFIX}) + +set (CONFIG_INCLUDE_DIRS_PC "") +foreach(_dir ${CONFIG_INCLUDE_DIRS}) + string(CONCAT CONFIG_INCLUDE_DIRS_PC "${CONFIG_INCLUDE_DIRS_PC} -I${_dir} " ) +endforeach() + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/deal.II_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_LIBRARY_RELDIR}/pkgconfig + COMPONENT library + ) + + +# generate the requested .pc files +foreach (_build ${DEAL_II_BUILD_TYPES}) + if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease") + set(_build "general") + else() + if(_build MATCHES DEBUG) + set(_build "debug") + else() + set(_build "release") + endif() + endif() + + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/deal.II_${_build}.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}_${_build}.pc + @ONLY + ) + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}_${_build}.pc + DESTINATION ${DEAL_II_LIBRARY_RELDIR}/pkgconfig + COMPONENT library + ) +endforeach() + + + + + + + + +# end of pkgconfig files +#################################################################### MESSAGE(STATUS "Setting up project configuration - Done") diff --git a/cmake/config/pkgconfig/deal.II.pc.in b/cmake/config/deal.II.pc.in similarity index 100% rename from cmake/config/pkgconfig/deal.II.pc.in rename to cmake/config/deal.II.pc.in diff --git a/cmake/config/pkgconfig/deal.II_base.pc.in b/cmake/config/deal.II_base.pc.in similarity index 91% rename from cmake/config/pkgconfig/deal.II_base.pc.in rename to cmake/config/deal.II_base.pc.in index 7194991a97..81d981162c 100644 --- a/cmake/config/pkgconfig/deal.II_base.pc.in +++ b/cmake/config/deal.II_base.pc.in @@ -1,7 +1,6 @@ DEAL_II_PATH=@DEAL_II_PATH_PC@ DEAL_II_INCLUDE_RELDIR=@DEAL_II_INCLUDE_RELDIR@ libdir=${DEAL_II_PATH}/@DEAL_II_LIBRARY_RELDIR@ -includedir=@CONFIG_INCLUDE_DIRS_PC@ Name: deal.II_base Description: base file used by the debug and release versions diff --git a/cmake/config/pkgconfig/deal.II_debug.pc.in b/cmake/config/deal.II_debug.pc.in similarity index 60% rename from cmake/config/pkgconfig/deal.II_debug.pc.in rename to cmake/config/deal.II_debug.pc.in index 01cbd9c6a5..868cb996a8 100644 --- a/cmake/config/pkgconfig/deal.II_debug.pc.in +++ b/cmake/config/deal.II_debug.pc.in @@ -1,9 +1,9 @@ DEAL_II_PATH=@DEAL_II_PATH_PC@ Name: deal.II compiled in debug mode -Description: A C++ software library supporting the creation of finite element codes and an open community of users and developers. +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 +Requires: deal.II_base Cflags: @DEAL_II_CXX_FLAGS_DEBUG@ Libs: @DEAL_II_LINKER_FLAGS_DEBUG@ @CONFIG_LIBRARIES_DEBUG_PC@ diff --git a/cmake/config/pkgconfig/deal.II_release.pc.in b/cmake/config/deal.II_release.pc.in similarity index 60% rename from cmake/config/pkgconfig/deal.II_release.pc.in rename to cmake/config/deal.II_release.pc.in index af84a83fea..daaf6cac57 100644 --- a/cmake/config/pkgconfig/deal.II_release.pc.in +++ b/cmake/config/deal.II_release.pc.in @@ -1,8 +1,8 @@ DEAL_II_PATH=@DEAL_II_PATH_PC@ Name: deal.II compiled in debug mode -Description: A C++ software library supporting the creation of finite element codes and an open community of users and developers. +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 +Requires: deal.II_base Cflags: @DEAL_II_CXX_FLAGS_RELEASE@ Libs: @DEAL_II_LINKER_FLAGS_RELEASE@ @CONFIG_LIBRARIES_RELEASE_PC@ diff --git a/cmake/config/pkgconfig/CMakeLists.txt b/cmake/config/pkgconfig/CMakeLists.txt deleted file mode 100644 index c285ba784c..0000000000 --- a/cmake/config/pkgconfig/CMakeLists.txt +++ /dev/null @@ -1,165 +0,0 @@ -## --------------------------------------------------------------------- -## -## Copyright (C) 2018 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.md at -## the top level directory of deal.II. -## -## --------------------------------------------------------------------- - -# -# This file sets 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_general # generated when buildtype is different from above -# -# 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. -# -# pkgconfig looks for *.pc files in an environmental variable called -# PKG_CONFIG_PATH. So, to use the library in the build directory issue -# export PKG_CONFIG_PATH=/path/to/BUILD_DIR/lib/pkgconfig:$PKG_CONFIG_PATH -# -# To use the library in the installed location -# export PKG_CONFIG_PATH=/path/to/INSTALL_DIR/lib/pkgconfig:$PKG_CONFIG_PATH -# - - -# -# For binary dir (AKA build dir): -# - -set(DEAL_II_PATH_PC ${CMAKE_BINARY_DIR}) - -set (CONFIG_INCLUDE_DIRS_PC "") -foreach(_s ${CONFIG_INCLUDE_DIRS_BUILD_PC}) - string(CONCAT CONFIG_INCLUDE_DIRS_PC "${CONFIG_INCLUDE_DIRS_PC} -I${_s} " ) -endforeach() - -# populate the variables -# CONFIG_LIBRARIES_DEBUG_PC -# CONFIG_LIBRARIES_RELEASE_PC -# CONFIG_LIBRARIES_GENERAL_PC -foreach (_build ${DEAL_II_BUILD_TYPES}) - if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease") - set(_build "general") - else() - if(_build MATCHES DEBUG) - set(_build "debug") - else() - set(_build "release") - endif() - endif() - - string(TOUPPER ${_build} _B) - set(PC_LIBRARIES ${CONFIG_LIBRARIES_${_B}}) - set(CONFIG_LIBRARIES_PC "") - foreach(_s ${PC_LIBRARIES}) - # check if _s contains lib - # if _s is somethink like /path/to/trilinos/lib/libteuchos.so - # we have to add /path/to/trilinos/lib to the runpath - if(${_s} MATCHES "lib") - string(CONCAT CONFIG_LIBRARIES_PC " ${CONFIG_LIBRARIES_PC} ${_s} ") - - # work for the runpath - string(FIND ${_s} "/" _i REVERSE) - string(SUBSTRING ${_s} 0 ${_i} _p) - list(APPEND PC_RPATH ${_p}) - else() - # here _s is something like "m" for the libm.so so we add the -l flag - string(CONCAT CONFIG_LIBRARIES_PC " ${CONFIG_LIBRARIES_PC} -l${_s} " ) - endif() - endforeach() - - set(CONFIG_LIBRARIES_${_B}_PC ${CONFIG_LIBRARIES_PC}) - - list(REMOVE_DUPLICATES PC_RPATH) - foreach(_r ${PC_RPATH}) - string(CONCAT CONFIG_LIBRARIES_${_B}_PC " ${CONFIG_LIBRARIES_${_B}_PC} -Wl,-rpath,${_r} " ) - endforeach() - -endforeach() - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/deal.II_base.pc.in - ${CMAKE_BINARY_DIR}/${DEAL_II_LIBRARY_RELDIR}/pkgconfig/${DEAL_II_PROJECT_CONFIG_NAME}_base.pc - @ONLY - ) - -# generate the requested .pc files -foreach (_build ${DEAL_II_BUILD_TYPES}) - if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease") - set(_build "general") - else() - if(_build MATCHES DEBUG) - set(_build "debug") - else() - set(_build "release") - endif() - endif() - - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/deal.II_${_build}.pc.in - ${CMAKE_BINARY_DIR}/${DEAL_II_LIBRARY_RELDIR}/pkgconfig/${DEAL_II_PROJECT_CONFIG_NAME}_${_build}.pc - @ONLY - ) -endforeach() - -############################################################################# -# -# For installation: -# - -set(DEAL_II_PATH_PC ${CMAKE_INSTALL_PREFIX}) - -set (CONFIG_INCLUDE_DIRS_PC "") -foreach(_s ${CONFIG_INCLUDE_DIRS_INSTALL_PC}) - string(CONCAT CONFIG_INCLUDE_DIRS_PC "${CONFIG_INCLUDE_DIRS_PC} -I${_s} " ) -endforeach() - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/deal.II_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_LIBRARY_RELDIR}/pkgconfig - COMPONENT library - ) - - -# generate the requested .pc files -foreach (_build ${DEAL_II_BUILD_TYPES}) - if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease") - set(_build "general") - else() - if(_build MATCHES DEBUG) - set(_build "debug") - else() - set(_build "release") - endif() - endif() - - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/deal.II_${_build}.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}_${_build}.pc - @ONLY - ) - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}_${_build}.pc - DESTINATION ${DEAL_II_LIBRARY_RELDIR}/pkgconfig - COMPONENT library - ) -endforeach() - diff --git a/cmake/config/pkgconfig/deal.II_general.pc.in b/cmake/config/pkgconfig/deal.II_general.pc.in deleted file mode 100644 index 55bf088b4a..0000000000 --- a/cmake/config/pkgconfig/deal.II_general.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -DEAL_II_PATH=@DEAL_II_PATH_PC@ -Name: deal.II compiled in debug mode -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_GENERAL@ -Libs: @DEAL_II_LINKER_FLAGS_GENERAL@ @CONFIG_LIBRARIES_GENERAL_PC@ - -