summaryrefslogtreecommitdiff
path: root/Tests/RunCMake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake2
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-WARN.cmake2
-rw-r--r--Tests/RunCMake/CMP0042/CMP0042-NEW-result.txt1
-rw-r--r--Tests/RunCMake/CMP0042/CMP0042-NEW-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0042/CMP0042-NEW.cmake4
-rw-r--r--Tests/RunCMake/CMP0042/CMP0042-OLD-result.txt1
-rw-r--r--Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0042/CMP0042-OLD.cmake4
-rw-r--r--Tests/RunCMake/CMP0042/CMP0042-WARN-result.txt1
-rw-r--r--Tests/RunCMake/CMP0042/CMP0042-WARN-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0042/CMP0042-WARN.cmake9
-rw-r--r--Tests/RunCMake/CMP0042/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0042/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/CMP0042/empty.cpp7
-rw-r--r--Tests/RunCMake/CMakeLists.txt3
15 files changed, 54 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake
index 57c3ed0d7c..2e76ee0df0 100644
--- a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake
@@ -1,5 +1,7 @@
enable_language(CXX)
+cmake_policy(SET CMP0042 NEW)
+
add_library(foo SHARED empty_vs6_1.cpp)
add_library(bar SHARED empty_vs6_2.cpp)
target_link_libraries(bar foo)
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake
index fe7e858b7a..e3552b2f04 100644
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake
+++ b/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake
@@ -1,6 +1,8 @@
project(CMP0022-WARN)
+cmake_policy(SET CMP0042 NEW)
+
add_library(foo SHARED empty_vs6_1.cpp)
add_library(bar SHARED empty_vs6_2.cpp)
add_library(bat SHARED empty_vs6_3.cpp)
diff --git a/Tests/RunCMake/CMP0042/CMP0042-NEW-result.txt b/Tests/RunCMake/CMP0042/CMP0042-NEW-result.txt
new file mode 100644
index 0000000000..573541ac97
--- /dev/null
+++ b/Tests/RunCMake/CMP0042/CMP0042-NEW-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0042/CMP0042-NEW-stderr.txt b/Tests/RunCMake/CMP0042/CMP0042-NEW-stderr.txt
new file mode 100644
index 0000000000..10f32932ee
--- /dev/null
+++ b/Tests/RunCMake/CMP0042/CMP0042-NEW-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/CMP0042/CMP0042-NEW.cmake b/Tests/RunCMake/CMP0042/CMP0042-NEW.cmake
new file mode 100644
index 0000000000..778a444311
--- /dev/null
+++ b/Tests/RunCMake/CMP0042/CMP0042-NEW.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0042 NEW)
+
+add_library(foo SHARED empty.cpp)
diff --git a/Tests/RunCMake/CMP0042/CMP0042-OLD-result.txt b/Tests/RunCMake/CMP0042/CMP0042-OLD-result.txt
new file mode 100644
index 0000000000..573541ac97
--- /dev/null
+++ b/Tests/RunCMake/CMP0042/CMP0042-OLD-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt b/Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt
new file mode 100644
index 0000000000..10f32932ee
--- /dev/null
+++ b/Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/CMP0042/CMP0042-OLD.cmake b/Tests/RunCMake/CMP0042/CMP0042-OLD.cmake
new file mode 100644
index 0000000000..1aede967c2
--- /dev/null
+++ b/Tests/RunCMake/CMP0042/CMP0042-OLD.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0042 OLD)
+
+add_library(foo SHARED empty.cpp)
diff --git a/Tests/RunCMake/CMP0042/CMP0042-WARN-result.txt b/Tests/RunCMake/CMP0042/CMP0042-WARN-result.txt
new file mode 100644
index 0000000000..573541ac97
--- /dev/null
+++ b/Tests/RunCMake/CMP0042/CMP0042-WARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0042/CMP0042-WARN-stderr.txt b/Tests/RunCMake/CMP0042/CMP0042-WARN-stderr.txt
new file mode 100644
index 0000000000..f3574a1a56
--- /dev/null
+++ b/Tests/RunCMake/CMP0042/CMP0042-WARN-stderr.txt
@@ -0,0 +1,10 @@
+CMake Warning \(dev\):
+ Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
+ --help-policy CMP0042" for policy details. Use the cmake_policy command to
+ set the policy and suppress this warning.
+
+ MACOSX_RPATH is not specified for the following targets:
+
+ foo
+
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0042/CMP0042-WARN.cmake b/Tests/RunCMake/CMP0042/CMP0042-WARN.cmake
new file mode 100644
index 0000000000..3fa32b16ff
--- /dev/null
+++ b/Tests/RunCMake/CMP0042/CMP0042-WARN.cmake
@@ -0,0 +1,9 @@
+
+add_library(foo SHARED empty.cpp)
+add_library(foo-static STATIC empty.cpp)
+add_library(foo2 SHARED empty.cpp)
+set_target_properties(foo2 PROPERTIES MACOSX_RPATH 1)
+add_library(foo3 SHARED empty.cpp)
+set_target_properties(foo3 PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@loader_path")
+add_library(foo4 SHARED empty.cpp)
+set_target_properties(foo4 PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@rpath")
diff --git a/Tests/RunCMake/CMP0042/CMakeLists.txt b/Tests/RunCMake/CMP0042/CMakeLists.txt
new file mode 100644
index 0000000000..11ea636d04
--- /dev/null
+++ b/Tests/RunCMake/CMP0042/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} CXX)
+include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/CMP0042/RunCMakeTest.cmake b/Tests/RunCMake/CMP0042/RunCMakeTest.cmake
new file mode 100644
index 0000000000..3b226d74cb
--- /dev/null
+++ b/Tests/RunCMake/CMP0042/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0042-OLD)
+run_cmake(CMP0042-NEW)
+run_cmake(CMP0042-WARN)
diff --git a/Tests/RunCMake/CMP0042/empty.cpp b/Tests/RunCMake/CMP0042/empty.cpp
new file mode 100644
index 0000000000..bfbbddeb90
--- /dev/null
+++ b/Tests/RunCMake/CMP0042/empty.cpp
@@ -0,0 +1,7 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int empty()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 96b054382e..96724ce880 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -61,6 +61,9 @@ add_RunCMake_test(CMP0038)
add_RunCMake_test(CMP0039)
add_RunCMake_test(CMP0040)
add_RunCMake_test(CMP0041)
+if(CMAKE_SYSTEM_NAME MATCHES Darwin AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
+ add_RunCMake_test(CMP0042)
+endif()
add_RunCMake_test(CTest)
if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles")
add_RunCMake_test(CompilerChange)