summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMP0065/subproject
diff options
context:
space:
mode:
authorChuck Atkins <chuck.atkins@kitware.com>2015-08-24 18:33:31 (GMT)
committerBrad King <brad.king@kitware.com>2015-09-21 14:12:13 (GMT)
commit9784af1b50a142c0160058734c7e12cee5f2a15e (patch)
tree864a958bf6accb58c6d9de434e1675f4addd38b7 /Tests/RunCMake/CMP0065/subproject
parent402bf096ec4aac75af096c3708ce51efaf4589d0 (diff)
downloadCMake-9784af1b50a142c0160058734c7e12cee5f2a15e.zip
CMake-9784af1b50a142c0160058734c7e12cee5f2a15e.tar.gz
CMake-9784af1b50a142c0160058734c7e12cee5f2a15e.tar.bz2
CMP0065: Restrict the use of CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS
This new policy restricts the addition of the shared library link flags to executables only when the ENABLE_EXPORTS property is set to True.
Diffstat (limited to 'Tests/RunCMake/CMP0065/subproject')
-rw-r--r--Tests/RunCMake/CMP0065/subproject/CMakeLists.txt22
-rw-r--r--Tests/RunCMake/CMP0065/subproject/main.c7
2 files changed, 29 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt b/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt
new file mode 100644
index 0000000..bed5960
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 3.3)
+
+project(TestPolicyCMP0065 C)
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS BADFLAGS)
+
+#----------------------------------------------------------------------
+cmake_policy(SET CMP0065 OLD)
+add_executable(FooOLDBad1 main.c)
+
+#----------------------------------------------------------------------
+cmake_policy(SET CMP0065 OLD)
+add_executable(FooOLDBad2 main.c)
+set_target_properties(FooOLDBad2 PROPERTIES ENABLE_EXPORTS ON)
+
+#----------------------------------------------------------------------
+cmake_policy(SET CMP0065 NEW)
+add_executable(FooNEWGood main.c)
+
+#----------------------------------------------------------------------
+cmake_policy(SET CMP0065 NEW)
+add_executable(FooNEWBad main.c)
+set_target_properties(FooNEWBad PROPERTIES ENABLE_EXPORTS ON)
diff --git a/Tests/RunCMake/CMP0065/subproject/main.c b/Tests/RunCMake/CMP0065/subproject/main.c
new file mode 100644
index 0000000..98725db
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/subproject/main.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ printf("Hello World\n");
+ return 0;
+}