diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/try_compile/CMP0137-Common.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/try_compile/CMP0137-NEW-stdout.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/try_compile/CMP0137-NEW.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/try_compile/CMP0137-WARN-stdout.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/try_compile/CMP0137-WARN.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/try_compile/CMP0137/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/try_compile/RunCMakeTest.cmake | 2 |
7 files changed, 24 insertions, 0 deletions
diff --git a/Tests/RunCMake/try_compile/CMP0137-Common.cmake b/Tests/RunCMake/try_compile/CMP0137-Common.cmake new file mode 100644 index 0000000..867475d --- /dev/null +++ b/Tests/RunCMake/try_compile/CMP0137-Common.cmake @@ -0,0 +1,8 @@ +set(CMAKE_ENABLE_EXPORTS 1) +set(FOO 2) +set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES FOO) +try_compile(RESULT_VAR + ${CMAKE_CURRENT_BINARY_DIR}/CMP0137-build + ${CMAKE_CURRENT_SOURCE_DIR}/CMP0137 + TestCMP0137) +include(${CMAKE_CURRENT_BINARY_DIR}/CMP0137-build/info.cmake OPTIONAL) diff --git a/Tests/RunCMake/try_compile/CMP0137-NEW-stdout.txt b/Tests/RunCMake/try_compile/CMP0137-NEW-stdout.txt new file mode 100644 index 0000000..0a6bb38 --- /dev/null +++ b/Tests/RunCMake/try_compile/CMP0137-NEW-stdout.txt @@ -0,0 +1,2 @@ +-- CMAKE_ENABLE_EXPORTS='1' +-- FOO='2' diff --git a/Tests/RunCMake/try_compile/CMP0137-NEW.cmake b/Tests/RunCMake/try_compile/CMP0137-NEW.cmake new file mode 100644 index 0000000..f7caa50 --- /dev/null +++ b/Tests/RunCMake/try_compile/CMP0137-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0137 NEW) +include(CMP0137-Common.cmake) diff --git a/Tests/RunCMake/try_compile/CMP0137-WARN-stdout.txt b/Tests/RunCMake/try_compile/CMP0137-WARN-stdout.txt new file mode 100644 index 0000000..fda1e41 --- /dev/null +++ b/Tests/RunCMake/try_compile/CMP0137-WARN-stdout.txt @@ -0,0 +1,2 @@ +-- CMAKE_ENABLE_EXPORTS='' +-- FOO='' diff --git a/Tests/RunCMake/try_compile/CMP0137-WARN.cmake b/Tests/RunCMake/try_compile/CMP0137-WARN.cmake new file mode 100644 index 0000000..61b5641 --- /dev/null +++ b/Tests/RunCMake/try_compile/CMP0137-WARN.cmake @@ -0,0 +1,2 @@ +# policy CMP0137 not set +include(CMP0137-Common.cmake) diff --git a/Tests/RunCMake/try_compile/CMP0137/CMakeLists.txt b/Tests/RunCMake/try_compile/CMP0137/CMakeLists.txt new file mode 100644 index 0000000..a3b9fda --- /dev/null +++ b/Tests/RunCMake/try_compile/CMP0137/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.23) +project(TestCMP0137 NONE) +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/info.cmake" " +message(STATUS \"CMAKE_ENABLE_EXPORTS='${CMAKE_ENABLE_EXPORTS}'\") +message(STATUS \"FOO='${FOO}'\") +") diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index dcd3799..eca7bf4 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -72,6 +72,8 @@ endif() run_cmake(CMP0056) run_cmake(CMP0066) run_cmake(CMP0067) +run_cmake(CMP0137-WARN) +run_cmake(CMP0137-NEW) if(RunCMake_GENERATOR MATCHES "Make|Ninja") # Use a single build tree for a few tests without cleaning. |