2019-01-19 11:39:44 +00:00
|
|
|
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
2021-03-18 15:08:52 +00:00
|
|
|
project(vectorwrapper VERSION 1.1.2)
|
2019-01-19 11:06:49 +00:00
|
|
|
|
2019-01-19 13:30:17 +00:00
|
|
|
include(CMakePackageConfigHelpers)
|
2020-05-05 09:02:58 +00:00
|
|
|
include(GNUInstallDirs)
|
2019-01-20 01:13:46 +00:00
|
|
|
include(CTest)
|
|
|
|
|
|
|
|
if (BUILD_TESTING)
|
2019-01-19 11:06:49 +00:00
|
|
|
add_subdirectory(test)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
include/vectorwrapper/vectorwrapper.hpp.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/include/vectorwrapper/vectorwrapper.hpp
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
|
2019-01-19 13:30:17 +00:00
|
|
|
write_basic_package_version_file(
|
|
|
|
${PROJECT_NAME}ConfigVersion.cmake
|
|
|
|
VERSION ${PACKAGE_VERSION}
|
2020-05-05 09:02:58 +00:00
|
|
|
COMPATIBILITY SameMajorVersion
|
|
|
|
ARCH_INDEPENDENT
|
2019-01-19 13:30:17 +00:00
|
|
|
)
|
|
|
|
|
2019-01-19 11:39:44 +00:00
|
|
|
add_library(${PROJECT_NAME} INTERFACE)
|
2020-04-07 21:53:19 +00:00
|
|
|
add_library(vwr::vectorwrapper ALIAS vectorwrapper)
|
2019-01-19 11:39:44 +00:00
|
|
|
target_include_directories(${PROJECT_NAME}
|
|
|
|
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
|
2020-04-07 21:53:19 +00:00
|
|
|
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
2019-01-19 11:39:44 +00:00
|
|
|
)
|
2021-04-08 13:01:42 +00:00
|
|
|
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)
|
2019-01-19 11:39:44 +00:00
|
|
|
|
2019-01-19 11:06:49 +00:00
|
|
|
install(DIRECTORY include/vectorwrapper
|
2020-05-05 09:02:58 +00:00
|
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
2019-01-19 11:06:49 +00:00
|
|
|
PATTERN vectorwrapper.hpp.in EXCLUDE
|
2020-05-05 09:02:58 +00:00
|
|
|
PATTERN meson.build EXCLUDE
|
2019-01-19 11:06:49 +00:00
|
|
|
)
|
|
|
|
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/vectorwrapper
|
2020-05-05 09:02:58 +00:00
|
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
2019-01-19 11:06:49 +00:00
|
|
|
)
|
2019-01-19 13:30:17 +00:00
|
|
|
install(FILES
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
2020-05-05 09:02:58 +00:00
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
2019-01-19 13:30:17 +00:00
|
|
|
)
|
2019-01-19 11:39:44 +00:00
|
|
|
|
|
|
|
install(TARGETS ${PROJECT_NAME}
|
|
|
|
EXPORT ${PROJECT_NAME}
|
2020-05-05 09:02:58 +00:00
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
2019-01-19 11:39:44 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
install(EXPORT ${PROJECT_NAME}
|
2019-01-19 13:30:17 +00:00
|
|
|
FILE ${PROJECT_NAME}Config.cmake
|
2019-01-19 11:39:44 +00:00
|
|
|
NAMESPACE vwr::
|
2020-05-05 09:02:58 +00:00
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
2019-01-19 11:39:44 +00:00
|
|
|
)
|