diff options
author | Brad King <brad.king@kitware.com> | 2020-06-26 13:35:24 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-06-26 13:35:31 (GMT) |
commit | ab83a21933a0b429a6c043ee808ea893d7817ef0 (patch) | |
tree | 54faef3c38d556e3d5fe257bd043f7d874802d30 /Tests/CMakeLists.txt | |
parent | 6e0143f3399d3f1a0857904d826dbdee7667612a (diff) | |
parent | 6051a49c78a36b82e77a62e09f0ba5a5b5d14532 (diff) | |
download | CMake-ab83a21933a0b429a6c043ee808ea893d7817ef0.zip CMake-ab83a21933a0b429a6c043ee808ea893d7817ef0.tar.gz CMake-ab83a21933a0b429a6c043ee808ea893d7817ef0.tar.bz2 |
Merge topic 'visual-studio-android'
6051a49c78 Visual Studio: Add Android support
bbcaf9689e Refactor: Add IsAndroidGuiExecutable() method to cmTarget
14456923bd cmGlobalVisualStudio10Generator: Move variable initialization to header
d5b5c19278 cmGlobalGenerator: FindMakeProgram() before CMakeDetermineSystem
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4898
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 61 |
1 files changed, 45 insertions, 16 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 1c88cd5..067ffdb 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -206,6 +206,26 @@ if(BUILD_TESTING) set(${reg} 0) endif() endforeach() + if(COMMAND cmake_host_system_information) + set(info_vs15 "VS_15_DIR") + set(info_vs16 "VS_16_DIR") + set(vs_versions) + if(WIN32) + if(NOT CMAKE_VERSION VERSION_LESS 3.14) + set(vs_versions vs15 vs16) + elseif(NOT CMAKE_VERSION VERSION_LESS 3.8) + set(vs_versions vs15) + endif() + endif() + foreach(info ${vs_versions}) + cmake_host_system_information(RESULT found QUERY "${info_${info}}") + if(found) + set(${info} 1) + else() + set(${info} 0) + endif() + endforeach() + endif() endif() #--------------------------------------------------------------------------- @@ -2306,32 +2326,41 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH endforeach() endif() + macro(add_test_VSAndroid name generator platform) + add_test(NAME "VSAndroid.${name}.${platform}" COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VSAndroid" + "${CMake_BINARY_DIR}/Tests/VSAndroid/${name}/${platform}" + --build-generator "${generator}" + --build-project VSAndroid + --build-config $<CONFIGURATION> + --build-options -DCMAKE_SYSTEM_NAME=Android "-A${platform}" + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSAndroid/${name}") + endmacro() if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ") - macro(add_test_VSNsightTegra name generator) - add_test(NAME VSNsightTegra.${name} COMMAND ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/VSNsightTegra" - "${CMake_BINARY_DIR}/Tests/VSNsightTegra/${name}" - --build-generator "${generator}" - --build-project VSNsightTegra - --build-config $<CONFIGURATION> - --build-options -DCMAKE_SYSTEM_NAME=Android - ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSNsightTegra/${name}") - endmacro() if(vs10) - add_test_VSNsightTegra(vs10 "Visual Studio 10 2010") + add_test_VSAndroid(vs10 "Visual Studio 10 2010" "Tegra-Android") endif() if(vs11) - add_test_VSNsightTegra(vs11 "Visual Studio 11 2012") + add_test_VSAndroid(vs11 "Visual Studio 11 2012" "Tegra-Android") endif() if(vs12) - add_test_VSNsightTegra(vs12 "Visual Studio 12 2013") + add_test_VSAndroid(vs12 "Visual Studio 12 2013" "Tegra-Android") endif() if(vs14) - add_test_VSNsightTegra(vs14 "Visual Studio 14 2015") + add_test_VSAndroid(vs14 "Visual Studio 14 2015" "Tegra-Android") endif() endif() + if(vs14 AND CMake_TEST_ANDROID_VS14) + add_test_VSAndroid(vs14 "Visual Studio 14 2015" "ARM") + endif() + if(vs15 AND CMake_TEST_ANDROID_VS15) + add_test_VSAndroid(vs15 "Visual Studio 15 2017" "ARM") + endif() + if(vs16 AND CMake_TEST_ANDROID_VS16) + add_test_VSAndroid(vs16 "Visual Studio 16 2019" "ARM") + endif() if (APPLE) if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") |