diff options
Diffstat (limited to 'Tests/RunCMake')
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) |