mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
691fd1cd0c
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.
22 lines
480 B
CMake
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)
|