diff options
author | Brad King <brad.king@kitware.com> | 2013-02-05 21:10:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-02-07 16:09:56 (GMT) |
commit | 56ca8d4e6365d67901e0cff7f2bd99f174537a97 (patch) | |
tree | 17473ad1dd7b67c915b53a17b0bca243b500cc45 /Tests/VSExternalInclude | |
parent | f36c665df80e8e3f4eca0fed28b5d1c3df739552 (diff) | |
download | CMake-56ca8d4e6365d67901e0cff7f2bd99f174537a97.zip CMake-56ca8d4e6365d67901e0cff7f2bd99f174537a97.tar.gz CMake-56ca8d4e6365d67901e0cff7f2bd99f174537a97.tar.bz2 |
Tests: Add generator toolset support
Propagate CMAKE_GENERATOR_TOOLSET through the test hierarchy so that all
tests can build with the selected generator toolset, if any.
Diffstat (limited to 'Tests/VSExternalInclude')
-rw-r--r-- | Tests/VSExternalInclude/CMakeLists.txt | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt index 399ac69..5ce15e0 100644 --- a/Tests/VSExternalInclude/CMakeLists.txt +++ b/Tests/VSExternalInclude/CMakeLists.txt @@ -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[01]") add_dependencies(VSExternalInclude lib1) endif() |