diff options
author | Brad King <brad.king@kitware.com> | 2021-07-21 15:31:16 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-07-21 15:31:29 (GMT) |
commit | 992467c30c893eb592e4dad1f4d2b59eb9dfe3c4 (patch) | |
tree | 9f94af83b777a0c5dacfce94c9ccb95484988342 /Tests | |
parent | dee0b88e770282909716967b9d3f4e626827e4ae (diff) | |
parent | 144be54dd31ad1320e3efa9b2b30876dcadd590a (diff) | |
download | CMake-992467c30c893eb592e4dad1f4d2b59eb9dfe3c4.zip CMake-992467c30c893eb592e4dad1f4d2b59eb9dfe3c4.tar.gz CMake-992467c30c893eb592e4dad1f4d2b59eb9dfe3c4.tar.bz2 |
Merge topic 'toolchain-CMP0126'
144be54dd3 try_compile: Propagate CMP0126 to the generated test project
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6366
Diffstat (limited to 'Tests')
11 files changed, 22 insertions, 0 deletions
diff --git a/Tests/RunCMake/ToolchainFile/CMP0126-NEW-stderr.txt b/Tests/RunCMake/ToolchainFile/CMP0126-NEW-stderr.txt new file mode 100644 index 0000000..7b91b43 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CMP0126-NEW-stderr.txt @@ -0,0 +1 @@ +^try_compile CMP0126='NEW' VAR='1' diff --git a/Tests/RunCMake/ToolchainFile/CMP0126-NEW-toolchain.cmake b/Tests/RunCMake/ToolchainFile/CMP0126-NEW-toolchain.cmake new file mode 100644 index 0000000..2f1ec86 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CMP0126-NEW-toolchain.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/CMP0126-toolchain.cmake") diff --git a/Tests/RunCMake/ToolchainFile/CMP0126-NEW.cmake b/Tests/RunCMake/ToolchainFile/CMP0126-NEW.cmake new file mode 100644 index 0000000..62d4df1 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CMP0126-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0126 NEW) +enable_language(C) diff --git a/Tests/RunCMake/ToolchainFile/CMP0126-OLD-stderr.txt b/Tests/RunCMake/ToolchainFile/CMP0126-OLD-stderr.txt new file mode 100644 index 0000000..f3c068a --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CMP0126-OLD-stderr.txt @@ -0,0 +1 @@ +^try_compile CMP0126='OLD' VAR='2' diff --git a/Tests/RunCMake/ToolchainFile/CMP0126-OLD-toolchain.cmake b/Tests/RunCMake/ToolchainFile/CMP0126-OLD-toolchain.cmake new file mode 100644 index 0000000..2f1ec86 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CMP0126-OLD-toolchain.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/CMP0126-toolchain.cmake") diff --git a/Tests/RunCMake/ToolchainFile/CMP0126-OLD.cmake b/Tests/RunCMake/ToolchainFile/CMP0126-OLD.cmake new file mode 100644 index 0000000..ef821fe --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CMP0126-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0126 OLD) +enable_language(C) diff --git a/Tests/RunCMake/ToolchainFile/CMP0126-WARN-stderr.txt b/Tests/RunCMake/ToolchainFile/CMP0126-WARN-stderr.txt new file mode 100644 index 0000000..f3c068a --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CMP0126-WARN-stderr.txt @@ -0,0 +1 @@ +^try_compile CMP0126='OLD' VAR='2' diff --git a/Tests/RunCMake/ToolchainFile/CMP0126-WARN-toolchain.cmake b/Tests/RunCMake/ToolchainFile/CMP0126-WARN-toolchain.cmake new file mode 100644 index 0000000..2f1ec86 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CMP0126-WARN-toolchain.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/CMP0126-toolchain.cmake") diff --git a/Tests/RunCMake/ToolchainFile/CMP0126-WARN.cmake b/Tests/RunCMake/ToolchainFile/CMP0126-WARN.cmake new file mode 100644 index 0000000..426e2b1 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CMP0126-WARN.cmake @@ -0,0 +1,2 @@ +# leave CMP0126 unset +enable_language(C) diff --git a/Tests/RunCMake/ToolchainFile/CMP0126-toolchain.cmake b/Tests/RunCMake/ToolchainFile/CMP0126-toolchain.cmake new file mode 100644 index 0000000..d5af14f --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CMP0126-toolchain.cmake @@ -0,0 +1,7 @@ +get_property(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE) +if(_IN_TC) + cmake_policy(GET CMP0126 cmp0126) + set(VAR 1) + set(VAR 2 CACHE STRING "") + message("try_compile CMP0126='${cmp0126}' VAR='${VAR}'") +endif() diff --git a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake index 304c105..7744ee8 100644 --- a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake +++ b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake @@ -11,6 +11,9 @@ run_cmake_toolchain(CheckLanguage) run_cmake_toolchain(FlagsInit) run_cmake_toolchain(LangVars) run_cmake_toolchain(LinkFlagsInit) +run_cmake_toolchain(CMP0126-NEW) +run_cmake_toolchain(CMP0126-OLD) +run_cmake_toolchain(CMP0126-WARN) function(run_IncludeDirectories) run_cmake_toolchain(IncludeDirectories) |