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 b429b27 commit e8f668d
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)

project(tsl-sparse-map VERSION 0.6.2 LANGUAGES CXX)
include(GNUInstallDirs)
Expand Down Expand Up @@ -26,52 +26,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-sparse-map.natvis"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}")
endif()
if(MSVC)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/tsl-sparse-map.natvis"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}")
endif()



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

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



## Create and install tsl-sparse-mapTargets.cmake
install(TARGETS sparse_map
EXPORT tsl-sparse-mapTargets)
## Create and install tsl-sparse-mapTargets.cmake
install(TARGETS sparse_map
EXPORT tsl-sparse-mapTargets)

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



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

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

0 comments on commit e8f668d

Please sign in to comment.