Skip to content

Commit

Permalink
Bump cmake_minimum_required version to 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Tessil committed Sep 22, 2024
1 parent 1e77386 commit 448eeff
Showing 1 changed file with 29 additions and 32 deletions.
61 changes: 29 additions & 32 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.5)
include(GNUInstallDirs)


Expand All @@ -21,47 +21,44 @@ target_sources(array_hash INTERFACE "$<BUILD_INTERFACE:${headers}>")



# Installation (only compatible with CMake version >= 3.3)
if(${CMAKE_VERSION} VERSION_GREATER "3.2")
include(CMakePackageConfigHelpers)
include(CMakePackageConfigHelpers)

## Install include directory
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
## Install include directory
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")



## Create and install tsl-array-hashConfig.cmake
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/tsl-array-hashConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/tsl-array-hashConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-array-hash")
## Create and install tsl-array-hashConfig.cmake
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/tsl-array-hashConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/tsl-array-hashConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-array-hash")

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tsl-array-hashConfig.cmake"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-array-hash")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tsl-array-hashConfig.cmake"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-array-hash")



## Create and install tsl-array-hashTargets.cmake
install(TARGETS array_hash
EXPORT tsl-array-hashTargets)
## Create and install tsl-array-hashTargets.cmake
install(TARGETS array_hash
EXPORT tsl-array-hashTargets)

install(EXPORT tsl-array-hashTargets
NAMESPACE tsl::
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-array-hash")
install(EXPORT tsl-array-hashTargets
NAMESPACE tsl::
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-array-hash")



## Create and install tsl-array-hashConfigVersion.cmake
# tsl-array-hash is header-only and does not depend on the architecture.
# Remove CMAKE_SIZEOF_VOID_P from tsl-array-hashConfigVersion.cmake so that a
# tsl-array-hashConfig.cmake generated for a 64 bit target can be used for 32 bit
# targets and vice versa.
set(CMAKE_SIZEOF_VOID_P_BACKUP ${CMAKE_SIZEOF_VOID_P})
unset(CMAKE_SIZEOF_VOID_P)
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/tsl-array-hashConfigVersion.cmake"
COMPATIBILITY SameMajorVersion)
set(CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P_BACKUP})
## Create and install tsl-array-hashConfigVersion.cmake
# tsl-array-hash is header-only and does not depend on the architecture.
# Remove CMAKE_SIZEOF_VOID_P from tsl-array-hashConfigVersion.cmake so that a
# tsl-array-hashConfig.cmake generated for a 64 bit target can be used for 32 bit
# targets and vice versa.
set(CMAKE_SIZEOF_VOID_P_BACKUP ${CMAKE_SIZEOF_VOID_P})
unset(CMAKE_SIZEOF_VOID_P)
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/tsl-array-hashConfigVersion.cmake"
COMPATIBILITY SameMajorVersion)
set(CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P_BACKUP})

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tsl-array-hashConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-array-hash")
endif()
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tsl-array-hashConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-array-hash")

0 comments on commit 448eeff

Please sign in to comment.