From c0f4a6107412dc7bdbd810b86407016af723cb79 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 12 Sep 2013 17:12:42 +0200 Subject: [PATCH] CMP0022: Add unit test for null pointer check and message. --- .../CMP0022/CMP0022-WARN-empty-old-result.txt | 1 + .../CMP0022/CMP0022-WARN-empty-old-stderr.txt | 17 +++++++++++++++++ .../CMP0022/CMP0022-WARN-empty-old.cmake | 10 ++++++++++ Tests/RunCMake/CMP0022/RunCMakeTest.cmake | 1 + 4 files changed, 29 insertions(+) create mode 100644 Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-result.txt create mode 100644 Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt create mode 100644 Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old.cmake diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-result.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-result.txt new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt new file mode 100644 index 000000000..6d519f037 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt @@ -0,0 +1,17 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link + interface. Run "cmake --help-policy CMP0022" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + Target "bar" has a INTERFACE_LINK_LIBRARIES property which differs from its + LINK_INTERFACE_LIBRARIES properties. + + INTERFACE_LINK_LIBRARIES: + + foo + + LINK_INTERFACE_LIBRARIES: + + \(empty\) + +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old.cmake new file mode 100644 index 000000000..c5d3c29d9 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old.cmake @@ -0,0 +1,10 @@ + +project(CMP0022-WARN-empty-old) + +add_library(foo SHARED empty_vs6_1.cpp) +add_library(bar SHARED empty_vs6_2.cpp) + +set_property(TARGET bar PROPERTY INTERFACE_LINK_LIBRARIES foo) + +add_library(user empty.cpp) +target_link_libraries(user bar) diff --git a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake index dcef0f5b4..8e5824aea 100644 --- a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake @@ -3,6 +3,7 @@ include(RunCMake) run_cmake(CMP0022-WARN) run_cmake(CMP0022-WARN-tll) run_cmake(CMP0022-WARN-static) +run_cmake(CMP0022-WARN-empty-old) run_cmake(CMP0022-NOWARN-static) run_cmake(CMP0022-NOWARN-static-link_libraries) run_cmake(CMP0022-export)