Skip to content

Commit

Permalink
Bump cmake_minimum_required to 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Tessil committed Sep 14, 2024
1 parent 7f32a77 commit 917a68c
Showing 1 changed file with 33 additions and 36 deletions.
69 changes: 33 additions & 36 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 Down Expand Up @@ -29,52 +29,49 @@ endif()



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

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

if(MSVC)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/tsl-hopscotch-map.natvis"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}")
endif()
if(MSVC)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/tsl-hopscotch-map.natvis"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}")
endif()



## Create and install tsl-hopscotch-mapConfig.cmake
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/tsl-hopscotch-mapConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/tsl-hopscotch-mapConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-hopscotch-map")
## Create and install tsl-hopscotch-mapConfig.cmake
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/tsl-hopscotch-mapConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/tsl-hopscotch-mapConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-hopscotch-map")

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tsl-hopscotch-mapConfig.cmake"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-hopscotch-map")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tsl-hopscotch-mapConfig.cmake"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-hopscotch-map")



## Create and install tsl-hopscotch-mapTargets.cmake
install(TARGETS hopscotch_map
EXPORT tsl-hopscotch-mapTargets)
## Create and install tsl-hopscotch-mapTargets.cmake
install(TARGETS hopscotch_map
EXPORT tsl-hopscotch-mapTargets)

install(EXPORT tsl-hopscotch-mapTargets
NAMESPACE tsl::
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-hopscotch-map")
install(EXPORT tsl-hopscotch-mapTargets
NAMESPACE tsl::
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-hopscotch-map")



## Create and install tsl-hopscotch-mapConfigVersion.cmake
# tsl-hopscotch-map is header-only and does not depend on the architecture.
# Remove CMAKE_SIZEOF_VOID_P from tsl-hopscotch-mapConfigVersion.cmake so that a
# tsl-hopscotch-mapConfig.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-hopscotch-mapConfigVersion.cmake"
COMPATIBILITY SameMajorVersion)
set(CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P_BACKUP})
## Create and install tsl-hopscotch-mapConfigVersion.cmake
# tsl-hopscotch-map is header-only and does not depend on the architecture.
# Remove CMAKE_SIZEOF_VOID_P from tsl-hopscotch-mapConfigVersion.cmake so that a
# tsl-hopscotch-mapConfig.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-hopscotch-mapConfigVersion.cmake"
COMPATIBILITY SameMajorVersion)
set(CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P_BACKUP})

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tsl-hopscotch-mapConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-hopscotch-map")
endif()
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tsl-hopscotch-mapConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-hopscotch-map")

0 comments on commit 917a68c

Please sign in to comment.