diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2013-12-19 04:25:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-01-02 18:41:49 (GMT) |
commit | d25ad482e978cbf5e4fcfa8b1dcc342ba93dcda0 (patch) | |
tree | f0a1f688356d4f346279bacc9203c467a5bb76ac /Tests | |
parent | 2a384e08cc0809fec75ebb20be585fb5a1bf591a (diff) | |
download | CMake-d25ad482e978cbf5e4fcfa8b1dcc342ba93dcda0.zip CMake-d25ad482e978cbf5e4fcfa8b1dcc342ba93dcda0.tar.gz CMake-d25ad482e978cbf5e4fcfa8b1dcc342ba93dcda0.tar.bz2 |
OS X: Add CMP0042 to enable MACOSX_RPATH by default
Also adding documentation for CMAKE_MACOSX_RPATH, and improving
documentation for MACOSX_RPATH.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/MacRuntimePath/A/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0022/CMP0022-WARN.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0042/CMP0042-NEW-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0042/CMP0042-NEW-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0042/CMP0042-NEW.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0042/CMP0042-OLD-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0042/CMP0042-OLD.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0042/CMP0042-WARN-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0042/CMP0042-WARN-stderr.txt | 10 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0042/CMP0042-WARN.cmake | 9 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0042/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0042/RunCMakeTest.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0042/empty.cpp | 7 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 3 |
16 files changed, 58 insertions, 2 deletions
diff --git a/Tests/MacRuntimePath/A/CMakeLists.txt b/Tests/MacRuntimePath/A/CMakeLists.txt index 5fc54f4..ade0a3c 100644 --- a/Tests/MacRuntimePath/A/CMakeLists.txt +++ b/Tests/MacRuntimePath/A/CMakeLists.txt @@ -10,13 +10,15 @@ add_library(shared2 SHARED shared.cpp shared.h) set_target_properties(shared2 PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@rpath") +cmake_policy(SET CMP0042 NEW) + # a framework library add_library(framework SHARED framework.cpp framework.h) -set_target_properties(framework PROPERTIES MACOSX_RPATH 1 FRAMEWORK 1) +set_target_properties(framework PROPERTIES FRAMEWORK 1) # another framework add_library(framework2 SHARED framework2.cpp framework2.h) -set_target_properties(framework2 PROPERTIES MACOSX_RPATH 1 FRAMEWORK 1) +set_target_properties(framework2 PROPERTIES FRAMEWORK 1) # executable to test a shared library dependency with install rpaths add_executable(test1 test1.cpp) diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake index 57c3ed0..2e76ee0 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 fe7e858..e3552b2 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 0000000..573541a --- /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 0000000..10f3293 --- /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 0000000..778a444 --- /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 0000000..573541a --- /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 0000000..10f3293 --- /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 0000000..1aede96 --- /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 0000000..573541a --- /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 0000000..f3574a1 --- /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 0000000..3fa32b1 --- /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 0000000..11ea636 --- /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 0000000..3b226d7 --- /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 0000000..bfbbdde --- /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 96b0543..96724ce 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) |