Skip to content

Commit d1fe450

Browse files
committed
cmake: config proper install filename
1 parent cc22fee commit d1fe450

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

cmake/config.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ include(CMakeFindDependencyMacro)
44

55
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
66

7-
find_dependency(HDF5 1.8.7 COMPONENTS Fortran)
7+
find_dependency(HDF5 COMPONENTS Fortran)
88

99
include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake)
1010

cmake/h5fortran.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ ExternalProject_Add(H5FORTRAN
2929
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..
3030
CMAKE_ARGS ${h5fortran_cmake_args}
3131
BUILD_BYPRODUCTS ${h5fortran_LIBRARIES}
32-
INACTIVITY_TIMEOUT 15
3332
CONFIGURE_HANDLED_BY_BUILD ON
3433
DEPENDS HDF5::HDF5
3534
)

cmake/install.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
include(CMakePackageConfigHelpers)
44

55
configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/config.cmake.in
6-
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${PROJECT_NAME}-config.cmake
6+
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${PROJECT_NAME}Config.cmake
77
INSTALL_DESTINATION cmake
88
)
99

1010
write_basic_package_version_file(
11-
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${PROJECT_NAME}-config-version.cmake
11+
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${PROJECT_NAME}ConfigVersion.cmake
1212
COMPATIBILITY SameMinorVersion
1313
)
1414

@@ -18,8 +18,8 @@ DESTINATION cmake
1818
)
1919

2020
install(FILES
21-
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${PROJECT_NAME}-config.cmake
22-
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${PROJECT_NAME}-config-version.cmake
21+
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${PROJECT_NAME}Config.cmake
22+
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${PROJECT_NAME}ConfigVersion.cmake
2323
DESTINATION cmake
2424
)
2525

cmake/options.cmake

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ endif()
2020

2121
cmake_path(SET CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/Modules)
2222

23-
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
24-
# will not take effect without FORCE
25-
# CMAKE_BINARY_DIR in case it's used from FetchContent
26-
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR} CACHE PATH "Install top-level directory" FORCE)
27-
endif()
28-
2923
# Rpath options necessary for shared library install to work correctly in user projects
3024
set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
3125
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
@@ -34,6 +28,17 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true)
3428
# Necessary for shared library with Visual Studio / Windows oneAPI
3529
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS true)
3630

31+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
32+
# will not take effect without FORCE
33+
# CMAKE_BINARY_DIR for use from FetchContent
34+
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR} CACHE PATH "Install top-level directory" FORCE)
35+
endif()
36+
37+
# allow CMAKE_PREFIX_PATH with ~ expand
38+
if(CMAKE_PREFIX_PATH)
39+
get_filename_component(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ABSOLUTE)
40+
endif()
41+
3742
# --- auto-ignore build directory
3843
if(NOT EXISTS ${PROJECT_BINARY_DIR}/.gitignore)
3944
file(WRITE ${PROJECT_BINARY_DIR}/.gitignore "*")

cmake/zlib.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ URL_HASH SHA256=${zlib_sha256}
4444
CMAKE_ARGS ${zlib_cmake_args}
4545
BUILD_BYPRODUCTS ${ZLIB_LIBRARIES}
4646
CONFIGURE_HANDLED_BY_BUILD ON
47-
INACTIVITY_TIMEOUT 15
47+
INACTIVITY_TIMEOUT 60
4848
)
4949
else()
5050
ExternalProject_Add(ZLIB
@@ -54,7 +54,7 @@ GIT_SHALLOW true
5454
CMAKE_ARGS ${zlib_cmake_args}
5555
BUILD_BYPRODUCTS ${ZLIB_LIBRARIES}
5656
CONFIGURE_HANDLED_BY_BUILD ON
57-
INACTIVITY_TIMEOUT 15
57+
INACTIVITY_TIMEOUT 60
5858
)
5959
endif()
6060

0 commit comments

Comments
 (0)