diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f1b0f1..8cc2f73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 2.8.12) project(GSL CXX) @@ -12,9 +12,9 @@ set(GSL_HEADERS "gsl/string_span" ) -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} -) +add_library(${PROJECT_NAME} INTERFACE) + +target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) install(FILES ${GSL_HEADERS} DESTINATION include/gsl diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3c3125e..d58a66b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -34,7 +34,7 @@ endif() function(add_gsl_test name) add_executable(${name} ${name}.cpp ../gsl/gsl ../gsl/gsl_assert ../gsl/gsl_util ../gsl/multi_span ../gsl/span ../gsl/string_span) - target_link_libraries(${name} UnitTest++) + target_link_libraries(${name} UnitTest++ GSL) install(TARGETS ${name} RUNTIME DESTINATION bin )