King_DuckZ 2019-01-19 13:30:17 +00:00
parent 0ffa18c0cf
commit 92775e075f

View file

@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.0 FATAL_ERROR) cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(vectorwrapper VERSION 1.1.0) project(vectorwrapper VERSION 1.1.0)
include(CMakePackageConfigHelpers)
if (BUILD_TESTS) if (BUILD_TESTS)
add_subdirectory(test) add_subdirectory(test)
endif() endif()
@ -11,9 +13,14 @@ configure_file(
@ONLY @ONLY
) )
write_basic_package_version_file(
${PROJECT_NAME}ConfigVersion.cmake
VERSION ${PACKAGE_VERSION}
COMPATIBILITY AnyNewerVersion
)
add_library(${PROJECT_NAME} INTERFACE) add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} target_include_directories(${PROJECT_NAME}
INTERFACE $<INSTALL_INTERFACE:include>
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
) )
@ -24,16 +31,21 @@ install(DIRECTORY include/vectorwrapper
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/vectorwrapper install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/vectorwrapper
DESTINATION include DESTINATION include
) )
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION lib/cmake/${PROJECT_NAME}
)
install(TARGETS ${PROJECT_NAME} install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME} EXPORT ${PROJECT_NAME}
PUBLIC_HEADER LIBRARY DESTINATION lib
DESTINATION include ARCHIVE DESTINATION lib
CONFIGURATIONS Release RUNTIME DESTINATION bin
INCLUDES DESTINATION include
) )
install(EXPORT ${PROJECT_NAME} install(EXPORT ${PROJECT_NAME}
DESTINATION cmake/Modules FILE ${PROJECT_NAME}Config.cmake
NAMESPACE vwr:: NAMESPACE vwr::
CONFIGURATIONS Release DESTINATION lib/cmake/${PROJECT_NAME}
) )