This commit is contained in:
parent
0ffa18c0cf
commit
92775e075f
1 changed files with 18 additions and 6 deletions
|
@ -1,6 +1,8 @@
|
|||
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
||||
project(vectorwrapper VERSION 1.1.0)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
if (BUILD_TESTS)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
@ -11,9 +13,14 @@ configure_file(
|
|||
@ONLY
|
||||
)
|
||||
|
||||
write_basic_package_version_file(
|
||||
${PROJECT_NAME}ConfigVersion.cmake
|
||||
VERSION ${PACKAGE_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion
|
||||
)
|
||||
|
||||
add_library(${PROJECT_NAME} INTERFACE)
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
INTERFACE $<INSTALL_INTERFACE: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
|
||||
DESTINATION include
|
||||
)
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
DESTINATION lib/cmake/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
EXPORT ${PROJECT_NAME}
|
||||
PUBLIC_HEADER
|
||||
DESTINATION include
|
||||
CONFIGURATIONS Release
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
INCLUDES DESTINATION include
|
||||
)
|
||||
|
||||
install(EXPORT ${PROJECT_NAME}
|
||||
DESTINATION cmake/Modules
|
||||
FILE ${PROJECT_NAME}Config.cmake
|
||||
NAMESPACE vwr::
|
||||
CONFIGURATIONS Release
|
||||
DESTINATION lib/cmake/${PROJECT_NAME}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue