Generate a cmakefile for importing this library from other projects.
This commit is contained in:
parent
19b12600d8
commit
0ffa18c0cf
1 changed files with 20 additions and 2 deletions
|
@ -1,5 +1,4 @@
|
|||
cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
|
||||
cmake_policy(SET CMP0048 NEW)
|
||||
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
||||
project(vectorwrapper VERSION 1.1.0)
|
||||
|
||||
if (BUILD_TESTS)
|
||||
|
@ -12,6 +11,12 @@ configure_file(
|
|||
@ONLY
|
||||
)
|
||||
|
||||
add_library(${PROJECT_NAME} INTERFACE)
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
INTERFACE $<INSTALL_INTERFACE:include>
|
||||
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
|
||||
)
|
||||
|
||||
install(DIRECTORY include/vectorwrapper
|
||||
DESTINATION include
|
||||
PATTERN vectorwrapper.hpp.in EXCLUDE
|
||||
|
@ -19,3 +24,16 @@ install(DIRECTORY include/vectorwrapper
|
|||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/vectorwrapper
|
||||
DESTINATION include
|
||||
)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
EXPORT ${PROJECT_NAME}
|
||||
PUBLIC_HEADER
|
||||
DESTINATION include
|
||||
CONFIGURATIONS Release
|
||||
)
|
||||
|
||||
install(EXPORT ${PROJECT_NAME}
|
||||
DESTINATION cmake/Modules
|
||||
NAMESPACE vwr::
|
||||
CONFIGURATIONS Release
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue