diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b96546..7f8aff3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,17 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 3.0.0) project(GSL CXX) -install( - DIRECTORY include/gsl - DESTINATION include -) +add_library(cppgsl INTERFACE) +target_include_directories(cppgsl INTERFACE + $ + $) + +install(TARGETS cppgsl EXPORT cppgslConfig) +install(DIRECTORY include/gsl DESTINATION include) + +export(EXPORT cppgslConfig) +install(EXPORT cppgslConfig DESTINATION cmake) enable_testing() add_subdirectory(tests) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 40c46d5..e01e83d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -34,7 +34,7 @@ endif() function(add_gsl_test name) add_executable(${name} ${name}.cpp) - target_link_libraries(${name} UnitTest++) + target_link_libraries(${name} UnitTest++ cppgsl) add_test( ${name} ${name}