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 bd8d5ef commit 5bbd647
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 @@ -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-ordered-map.natvis"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}")
endif()
if(MSVC)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/tsl-ordered-map.natvis"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}")
endif()



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

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



## Create and install tsl-ordered-mapTargets.cmake
install(TARGETS ordered_map
EXPORT tsl-ordered-mapTargets)
## Create and install tsl-ordered-mapTargets.cmake
install(TARGETS ordered_map
EXPORT tsl-ordered-mapTargets)

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



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

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

0 comments on commit 5bbd647

Please sign in to comment.