summaryrefslogtreecommitdiff
path: root/Tests/VSExternalInclude
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/VSExternalInclude')
-rw-r--r--Tests/VSExternalInclude/CMakeLists.txt20
-rw-r--r--Tests/VSExternalInclude/Lib1/CMakeLists.txt1
-rw-r--r--Tests/VSExternalInclude/Lib2/CMakeLists.txt1
3 files changed, 16 insertions, 6 deletions
diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt
index 399ac6997..8fc287145 100644
--- a/Tests/VSExternalInclude/CMakeLists.txt
+++ b/Tests/VSExternalInclude/CMakeLists.txt
@@ -6,7 +6,7 @@ if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
else()
set(PROJECT_EXT vcproj)
endif()
-if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[01]")
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[012]")
set(PROJECT_EXT vcxproj)
endif()
@@ -18,13 +18,21 @@ set(LIB2_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib2)
make_directory("${LIB2_BINARY_DIR}")
# generate lib1
-exec_program("${CMAKE_COMMAND}" "${LIB1_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\"
- \"${VSExternalInclude_SOURCE_DIR}/Lib1\" OUTPUT_VARIABLE OUT)
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -T "${CMAKE_GENERATOR_TOOLSET}" "${VSExternalInclude_SOURCE_DIR}/Lib1"
+ WORKING_DIRECTORY ${LIB1_BINARY_DIR}
+ OUTPUT_VARIABLE OUT
+ ERROR_VARIABLE OUT
+ )
message("CMAKE Ran with the following output:\n\"${OUT}\"")
# generate lib2
-exec_program("${CMAKE_COMMAND}" "${LIB2_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\"
- \"${VSExternalInclude_SOURCE_DIR}/Lib2\" OUTPUT_VARIABLE OUT)
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -T "${CMAKE_GENERATOR_TOOLSET}" "${VSExternalInclude_SOURCE_DIR}/Lib2"
+ WORKING_DIRECTORY ${LIB2_BINARY_DIR}
+ OUTPUT_VARIABLE OUT
+ ERROR_VARIABLE OUT
+ )
message("CMAKE Ran with the following output:\n\"${OUT}\"")
@@ -46,7 +54,7 @@ add_dependencies(VSExternalInclude lib2)
# and the sln file can no longer be the only source
# of that depend. So, for VS 10 make the executable
# depend on lib1 and lib2
-if(MSVC10 OR MSVC11)
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[012]")
add_dependencies(VSExternalInclude lib1)
endif()
diff --git a/Tests/VSExternalInclude/Lib1/CMakeLists.txt b/Tests/VSExternalInclude/Lib1/CMakeLists.txt
index 1cb01c5dd..9dfac8616 100644
--- a/Tests/VSExternalInclude/Lib1/CMakeLists.txt
+++ b/Tests/VSExternalInclude/Lib1/CMakeLists.txt
@@ -1,3 +1,4 @@
+set(CMAKE_SUPPRESS_REGENERATION 1)
project(LIB1)
set(SOURCES lib1.cpp)
diff --git a/Tests/VSExternalInclude/Lib2/CMakeLists.txt b/Tests/VSExternalInclude/Lib2/CMakeLists.txt
index f726c3f8b..f4513548d 100644
--- a/Tests/VSExternalInclude/Lib2/CMakeLists.txt
+++ b/Tests/VSExternalInclude/Lib2/CMakeLists.txt
@@ -1,3 +1,4 @@
+set(CMAKE_SUPPRESS_REGENERATION 1)
project(VSEXTERNAL_LIB2)
include_directories(${VSEXTERNAL_LIB2_SOURCE_DIR}/../Lib1)