summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-22 13:07:40 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-10-22 13:07:40 (GMT)
commit0d9e8b1ab9ff8c99700093ba76a4339e3f199350 (patch)
tree7813e3052d482c4a59b2296e9c3b60e780b73da0 /Tests
parentd8fe9f9de7f6a2dd08329565b0b03d4b5d3cdf29 (diff)
parentf063c45589e83bf8e4ef61f49b17084debf085a2 (diff)
downloadCMake-0d9e8b1ab9ff8c99700093ba76a4339e3f199350.zip
CMake-0d9e8b1ab9ff8c99700093ba76a4339e3f199350.tar.gz
CMake-0d9e8b1ab9ff8c99700093ba76a4339e3f199350.tar.bz2
Merge topic 'double-colon-is-imported'
f063c45 Consider targets with double colons to be IMPORTED or ALIAS targets.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/ExportImport/Export/Interface/CMakeLists.txt4
-rw-r--r--Tests/ExportImport/Import/Interface/CMakeLists.txt18
-rw-r--r--Tests/RunCMake/CMP0028/CMP0028-NEW-result.txt1
-rw-r--r--Tests/RunCMake/CMP0028/CMP0028-NEW-stderr.txt6
-rw-r--r--Tests/RunCMake/CMP0028/CMP0028-NEW.cmake5
-rw-r--r--Tests/RunCMake/CMP0028/CMP0028-OLD-result.txt1
-rw-r--r--Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0028/CMP0028-OLD.cmake5
-rw-r--r--Tests/RunCMake/CMP0028/CMP0028-WARN-result.txt1
-rw-r--r--Tests/RunCMake/CMP0028/CMP0028-WARN-stderr.txt11
-rw-r--r--Tests/RunCMake/CMP0028/CMP0028-WARN.cmake3
-rw-r--r--Tests/RunCMake/CMP0028/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0028/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/CMP0028/empty.cpp0
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
15 files changed, 54 insertions, 11 deletions
diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt
index fc9c0c7..b713262 100644
--- a/Tests/ExportImport/Export/Interface/CMakeLists.txt
+++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt
@@ -24,7 +24,7 @@ add_library(sharediface INTERFACE)
target_link_libraries(sharediface INTERFACE sharedlib)
export(TARGETS sharediface sharedlib headeronly
- NAMESPACE bld_
+ NAMESPACE bld::
FILE ../ExportInterfaceBuildTree.cmake
)
@@ -46,4 +46,4 @@ install(FILES
DESTINATION include/sharedlib
)
-install(EXPORT expInterface NAMESPACE exp_ DESTINATION lib/exp)
+install(EXPORT expInterface NAMESPACE exp:: DESTINATION lib/exp)
diff --git a/Tests/ExportImport/Import/Interface/CMakeLists.txt b/Tests/ExportImport/Import/Interface/CMakeLists.txt
index c7bd13e..cf7e2bc 100644
--- a/Tests/ExportImport/Import/Interface/CMakeLists.txt
+++ b/Tests/ExportImport/Import/Interface/CMakeLists.txt
@@ -10,18 +10,18 @@ set_property(TARGET define_iface PROPERTY
INTERFACE_COMPILE_DEFINITIONS DEFINE_IFACE_DEFINE)
add_executable(headeronlytest_bld headeronlytest.cpp)
-target_link_libraries(headeronlytest_bld bld_headeronly)
+target_link_libraries(headeronlytest_bld bld::headeronly)
-set_property(TARGET bld_sharediface APPEND PROPERTY INTERFACE_LINK_LIBRARIES define_iface)
+set_property(TARGET bld::sharediface APPEND PROPERTY INTERFACE_LINK_LIBRARIES define_iface)
add_executable(interfacetest_bld interfacetest.cpp)
-target_link_libraries(interfacetest_bld bld_sharediface)
+target_link_libraries(interfacetest_bld bld::sharediface)
include(CheckCXXSourceCompiles)
macro(do_try_compile prefix)
- set(CMAKE_REQUIRED_LIBRARIES ${prefix}headeronly)
+ set(CMAKE_REQUIRED_LIBRARIES ${prefix}::headeronly)
check_cxx_source_compiles(
"
#include \"headeronly.h\"
@@ -42,14 +42,14 @@ macro(do_try_compile prefix)
endif()
endmacro()
-do_try_compile(bld_)
+do_try_compile(bld)
add_executable(headeronlytest_exp headeronlytest.cpp)
-target_link_libraries(headeronlytest_exp exp_headeronly)
+target_link_libraries(headeronlytest_exp exp::headeronly)
-set_property(TARGET exp_sharediface APPEND PROPERTY INTERFACE_LINK_LIBRARIES define_iface)
+set_property(TARGET exp::sharediface APPEND PROPERTY INTERFACE_LINK_LIBRARIES define_iface)
add_executable(interfacetest_exp interfacetest.cpp)
-target_link_libraries(interfacetest_exp exp_sharediface)
+target_link_libraries(interfacetest_exp exp::sharediface)
-do_try_compile(exp_)
+do_try_compile(exp)
diff --git a/Tests/RunCMake/CMP0028/CMP0028-NEW-result.txt b/Tests/RunCMake/CMP0028/CMP0028-NEW-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/CMP0028-NEW-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0028/CMP0028-NEW-stderr.txt b/Tests/RunCMake/CMP0028/CMP0028-NEW-stderr.txt
new file mode 100644
index 0000000..a7b0799
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/CMP0028-NEW-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error at CMP0028-NEW.cmake:4 \(add_library\):
+ Target "foo" links to target "External::Library" but the target was not
+ found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or
+ a ALIAS target is missing\?
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0028/CMP0028-NEW.cmake b/Tests/RunCMake/CMP0028/CMP0028-NEW.cmake
new file mode 100644
index 0000000..a0a6ae8
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/CMP0028-NEW.cmake
@@ -0,0 +1,5 @@
+
+cmake_policy(SET CMP0028 NEW)
+
+add_library(foo empty.cpp)
+target_link_libraries(foo PRIVATE External::Library)
diff --git a/Tests/RunCMake/CMP0028/CMP0028-OLD-result.txt b/Tests/RunCMake/CMP0028/CMP0028-OLD-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/CMP0028-OLD-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt b/Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/CMP0028/CMP0028-OLD.cmake b/Tests/RunCMake/CMP0028/CMP0028-OLD.cmake
new file mode 100644
index 0000000..d4a870b
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/CMP0028-OLD.cmake
@@ -0,0 +1,5 @@
+
+cmake_policy(SET CMP0028 OLD)
+
+add_library(foo empty.cpp)
+target_link_libraries(foo PRIVATE External::Library)
diff --git a/Tests/RunCMake/CMP0028/CMP0028-WARN-result.txt b/Tests/RunCMake/CMP0028/CMP0028-WARN-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/CMP0028-WARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0028/CMP0028-WARN-stderr.txt b/Tests/RunCMake/CMP0028/CMP0028-WARN-stderr.txt
new file mode 100644
index 0000000..2ff6927
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/CMP0028-WARN-stderr.txt
@@ -0,0 +1,11 @@
+CMake Warning \(dev\) at CMP0028-WARN.cmake:2 \(add_library\):
+ Policy CMP0028 is not set: Double colon in target name means ALIAS or
+ IMPORTED target. Run "cmake --help-policy CMP0028" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ Target "foo" links to target "External::Library" but the target was not
+ found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or
+ a ALIAS target is missing\?
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0028/CMP0028-WARN.cmake b/Tests/RunCMake/CMP0028/CMP0028-WARN.cmake
new file mode 100644
index 0000000..70a6cc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/CMP0028-WARN.cmake
@@ -0,0 +1,3 @@
+
+add_library(foo empty.cpp)
+target_link_libraries(foo PRIVATE External::Library)
diff --git a/Tests/RunCMake/CMP0028/CMakeLists.txt b/Tests/RunCMake/CMP0028/CMakeLists.txt
new file mode 100644
index 0000000..f1d9cae
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.4)
+project(${RunCMake_TEST} CXX)
+include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/CMP0028/RunCMakeTest.cmake b/Tests/RunCMake/CMP0028/RunCMakeTest.cmake
new file mode 100644
index 0000000..293e27b
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0028-NEW)
+run_cmake(CMP0028-OLD)
+run_cmake(CMP0028-WARN)
diff --git a/Tests/RunCMake/CMP0028/empty.cpp b/Tests/RunCMake/CMP0028/empty.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/empty.cpp
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 52c8667..460732c 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -55,6 +55,7 @@ add_RunCMake_test(CMP0019)
add_RunCMake_test(CMP0022)
add_RunCMake_test(CMP0026)
add_RunCMake_test(CMP0027)
+add_RunCMake_test(CMP0028)
add_RunCMake_test(CTest)
if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles")
add_RunCMake_test(CompilerChange)