Skip to content

Commit 55ecd6f

Browse files
committed
v2.0 Patch
Signed-off-by: Rian Quinn <rianquinn@gmail.com>
1 parent c9e423d commit 55ecd6f

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

CMakeLists.txt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.7)
1+
cmake_minimum_required(VERSION 3.1.3)
22

33
project(GSL CXX)
44

@@ -25,7 +25,6 @@ if (CMAKE_VERSION VERSION_LESS 3.7.9)
2525
else()
2626
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
2727
endif()
28-
2928
endif()
3029
else ()
3130
# set the GSL library to be compiled only with c++14
@@ -49,17 +48,19 @@ target_include_directories(GSL INTERFACE
4948
>
5049
)
5150

52-
if (MSVC_IDE)
53-
option(VS_ADD_NATIVE_VISUALIZERS "Configure project to use Visual Studio native visualizers" TRUE)
54-
else()
55-
set(VS_ADD_NATIVE_VISUALIZERS FALSE CACHE INTERNAL "Native visualizers are Visual Studio extension" FORCE)
56-
endif()
51+
if ((CMAKE_VERSION GREATER 3.7.9) OR (CMAKE_VERSION EQUAL 3.7.9))
52+
if (MSVC_IDE)
53+
option(VS_ADD_NATIVE_VISUALIZERS "Configure project to use Visual Studio native visualizers" TRUE)
54+
else()
55+
set(VS_ADD_NATIVE_VISUALIZERS FALSE CACHE INTERNAL "Native visualizers are Visual Studio extension" FORCE)
56+
endif()
5757

58-
# add natvis file to the library so it will automatically be loaded into Visual Studio
59-
if(VS_ADD_NATIVE_VISUALIZERS)
60-
target_sources(GSL INTERFACE
61-
${CMAKE_CURRENT_SOURCE_DIR}/GSL.natvis
62-
)
58+
# add natvis file to the library so it will automatically be loaded into Visual Studio
59+
if(VS_ADD_NATIVE_VISUALIZERS)
60+
target_sources(GSL INTERFACE
61+
${CMAKE_CURRENT_SOURCE_DIR}/GSL.natvis
62+
)
63+
endif()
6364
endif()
6465

6566
install(

0 commit comments

Comments
 (0)