diff --git a/CMakeLists.txt b/CMakeLists.txt index 21836c8..86be1ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,8 +57,6 @@ install( ${CMAKE_CURRENT_BINARY_DIR}/cmake/mpifx-config-version.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mpifx) -GNUInstallDirs_get_absolute_install_dir(CMAKE_INSTALL_FULL_MODULEDIR CMAKE_INSTALL_MODULEDIR) - get_pkgconfig_params(PKGCONFIG_REQUIRES PKGCONFIG_LIBS PKGCONFIG_LIBS_PRIVATE PKGCONFIG_C_FLAGS) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/utils/export/mpifx.pc.in ${CMAKE_CURRENT_BINARY_DIR}/mpifx.pc @ONLY) diff --git a/cmake/MpiFxUtils.cmake b/cmake/MpiFxUtils.cmake index 7fa02b3..e94f5a7 100644 --- a/cmake/MpiFxUtils.cmake +++ b/cmake/MpiFxUtils.cmake @@ -38,7 +38,7 @@ function(get_pkgconfig_params pkgconfig_requires pkgconfig_libs pkgconfig_libs_p set(_pkgconfig_libs_private "${CMAKE_EXE_LINKER_FLAGS}") - set(_pkgconfig_c_flags "-I${CMAKE_INSTALL_FULL_MODULEDIR}") + set(_pkgconfig_c_flags "-I${CMAKE_INSTALL_FULL_INCLUDEDIR}/${INSTALL_MODULEDIR}") set(${pkgconfig_requires} "${_pkgconfig_requires}" PARENT_SCOPE) set(${pkgconfig_libs} "${_pkgconfig_libs}" PARENT_SCOPE) diff --git a/config.cmake b/config.cmake index c5e48e7..4cd2602 100644 --- a/config.cmake +++ b/config.cmake @@ -28,10 +28,8 @@ option(INSTALL_INCLUDE_FILES "Whether include / module files should be installed set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/_install" CACHE STRING "Directory to install the compiled code into") -#set(CMAKE_INSTALL_LIBDIR "lib" CACHE PATH "Installation directory for libraries") +set(INSTALL_INCLUDEDIR "mpifx" CACHE PATH + "Installation directory for header and include files (within standard include folder)") -set(CMAKE_INSTALL_INCLUDEDIR "include/mpifx" CACHE PATH - "Installation directory for header and include files") - -set(CMAKE_INSTALL_MODULEDIR "${CMAKE_INSTALL_INCLUDEDIR}/modfiles" CACHE PATH - "Installation directory for Fortran module files") +set(INSTALL_MODULEDIR "${INSTALL_INCLUDEDIR}/modfiles" CACHE PATH + "Installation directory for Fortran module files (within standard include folder)") diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 0175432..8fd9245 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -38,7 +38,7 @@ set_target_properties(mpifx PROPERTIES Fortran_MODULE_DIRECTORY ${BUILD_MOD_DIR} target_include_directories(mpifx PUBLIC $ - $) + $) install(TARGETS mpifx EXPORT mpifx-targets @@ -46,5 +46,5 @@ install(TARGETS mpifx LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) if(INSTALL_INCLUDE_FILES) - install(DIRECTORY ${BUILD_MOD_DIR}/ DESTINATION ${CMAKE_INSTALL_MODULEDIR}) + install(DIRECTORY ${BUILD_MOD_DIR}/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${INSTALL_MODULEDIR}) endif()