aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorNeil MacIntosh <neilmac@microsoft.com>2017-07-13 13:53:56 -0700
committerGitHub <noreply@github.com>2017-07-13 13:53:56 -0700
commitb2ee48433448556a7be63074f8aaf45ab47a95c1 (patch)
treedf94d91f17334f50c33dfea4763f3b4b282f5f85 /CMakeLists.txt
parent1f87ef73f1477e8adafa8b10ccee042897612a20 (diff)
downloadplatform_external_Microsoft-GSL-b2ee48433448556a7be63074f8aaf45ab47a95c1.tar.gz
platform_external_Microsoft-GSL-b2ee48433448556a7be63074f8aaf45ab47a95c1.tar.bz2
platform_external_Microsoft-GSL-b2ee48433448556a7be63074f8aaf45ab47a95c1.zip
Move from unittest-cpp to catch for unit testing. (#533)
Many thanks to @rianquinn. This should fix #495, #494 and #529.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 7 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4e4e48..e62a1d6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,13 +1,16 @@
-cmake_minimum_required(VERSION 2.8.7)
+cmake_minimum_required(VERSION 3.1.3)
project(GSL CXX)
+include(ExternalProject)
+find_package(Git REQUIRED)
+
# creates a library GSL which is an interface (header files only)
add_library(GSL INTERFACE)
# when minimum version required is 3.8.0 remove if below
# both branches do exactly the same thing
-if ( CMAKE_MAJOR_VERSION VERSION_LESS 3.7.9)
+if (CMAKE_MAJOR_VERSION VERSION_LESS 3.7.9)
if (NOT MSVC)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
@@ -16,7 +19,7 @@ if ( CMAKE_MAJOR_VERSION VERSION_LESS 3.7.9)
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
endif()
-
+
endif()
else ()
# set the GSL library to be compiled only with c++14
@@ -41,7 +44,7 @@ target_include_directories(GSL INTERFACE
)
# add natvis file to the library so it will automatically be loaded into Visual Studio
-target_sources(GSL INTERFACE
+target_sources(GSL INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/GSL.natvis
)