vectorwrapper/CMakeLists.txt

59 lines
1.6 KiB
Text
Raw Normal View History

cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
2021-03-18 15:08:52 +00:00
project(vectorwrapper VERSION 1.1.2)
include(CMakePackageConfigHelpers)
2020-05-05 09:02:58 +00:00
include(GNUInstallDirs)
include(CTest)
if (BUILD_TESTING)
add_subdirectory(test)
endif()
configure_file(
include/vectorwrapper/vectorwrapper.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/include/vectorwrapper/vectorwrapper.hpp
@ONLY
)
write_basic_package_version_file(
${PROJECT_NAME}ConfigVersion.cmake
VERSION ${PACKAGE_VERSION}
2020-05-05 09:02:58 +00:00
COMPATIBILITY SameMajorVersion
ARCH_INDEPENDENT
)
add_library(${PROJECT_NAME} INTERFACE)
add_library(vwr::vectorwrapper ALIAS vectorwrapper)
target_include_directories(${PROJECT_NAME}
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)
install(DIRECTORY include/vectorwrapper
2020-05-05 09:02:58 +00:00
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PATTERN vectorwrapper.hpp.in EXCLUDE
2020-05-05 09:02:58 +00:00
PATTERN meson.build EXCLUDE
)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/vectorwrapper
2020-05-05 09:02:58 +00:00
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
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}
)
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}
)
install(EXPORT ${PROJECT_NAME}
FILE ${PROJECT_NAME}Config.cmake
NAMESPACE vwr::
2020-05-05 09:02:58 +00:00
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)