GSL/CMakeLists.txt
Tiago Macarios 691fd1cd0c Make CMakeLists.txt current to CMake 3.8 features
This commit updates the CMake files to use newer CMake features.

GSL is now a INTERFACE and one only need to link against that interface
(include paths and natvis files will be taken care automatically).

Whene generating a VS project test will be properly nested into a test
subfolder.

if(compiler) expression were modified to generator expressions.
2017-04-17 21:04:43 -07:00

22 lines
480 B
CMake

cmake_minimum_required(VERSION 3.8.0)
project(GSL CXX)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
add_library(cppGSL INTERFACE)
set(CMAKE_CXX_EXTENSIONS OFF)
target_compile_features(cppGSL INTERFACE cxx_std_14)
target_include_directories(cppGSL INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/gsl>
)
target_sources(cppGSL INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/GSL.natvis
)
enable_testing()
add_subdirectory(tests)