mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Make GSL a CMake consumable header-only library
This commit is contained in:
parent
5905d2d774
commit
8782e6c6c4
@ -1,11 +1,17 @@
|
|||||||
cmake_minimum_required(VERSION 2.8.7)
|
cmake_minimum_required(VERSION 3.0.0)
|
||||||
|
|
||||||
project(GSL CXX)
|
project(GSL CXX)
|
||||||
|
|
||||||
install(
|
add_library(cppgsl INTERFACE)
|
||||||
DIRECTORY include/gsl
|
target_include_directories(cppgsl INTERFACE
|
||||||
DESTINATION include
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
)
|
$<INSTALL_INTERFACE:include>)
|
||||||
|
|
||||||
|
install(TARGETS cppgsl EXPORT cppgslConfig)
|
||||||
|
install(DIRECTORY include/gsl DESTINATION include)
|
||||||
|
|
||||||
|
export(EXPORT cppgslConfig)
|
||||||
|
install(EXPORT cppgslConfig DESTINATION cmake)
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
@ -34,7 +34,7 @@ endif()
|
|||||||
|
|
||||||
function(add_gsl_test name)
|
function(add_gsl_test name)
|
||||||
add_executable(${name} ${name}.cpp)
|
add_executable(${name} ${name}.cpp)
|
||||||
target_link_libraries(${name} UnitTest++)
|
target_link_libraries(${name} UnitTest++ cppgsl)
|
||||||
add_test(
|
add_test(
|
||||||
${name}
|
${name}
|
||||||
${name}
|
${name}
|
||||||
|
Loading…
Reference in New Issue
Block a user