summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuslan Baratov <ruslan_baratov@yahoo.com>2019-05-21 11:26:23 (GMT)
committerRuslan Baratov <ruslan_baratov@yahoo.com>2019-05-21 11:26:23 (GMT)
commit26ea022c3bf081d9e1f7266e5ae52719cb59301b (patch)
treebb6502e2e76f187e929e6bb863d6356acee71e27
parent1db0edb2a65b272a7c91e719e818da2e2ce49fb5 (diff)
downloadCMake-26ea022c3bf081d9e1f7266e5ae52719cb59301b.zip
CMake-26ea022c3bf081d9e1f7266e5ae52719cb59301b.tar.gz
CMake-26ea022c3bf081d9e1f7266e5ae52719cb59301b.tar.bz2
Add variable CMAKE_FRAMEWORK
-rw-r--r--Help/manual/cmake-variables.7.rst1
-rw-r--r--Help/release/dev/CMAKE_FRAMEWORK.rst6
-rw-r--r--Help/variable/CMAKE_FRAMEWORK.rst7
-rw-r--r--Source/cmTarget.cxx1
-rw-r--r--Tests/RunCMake/Framework/FrameworkLayout.cmake5
-rw-r--r--Tests/RunCMake/Framework/RunCMakeTest.cmake18
6 files changed, 32 insertions, 6 deletions
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index fd5e28f..1117488 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -350,6 +350,7 @@ Variables that Control the Build
/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG_INIT
/variable/CMAKE_EXE_LINKER_FLAGS_INIT
/variable/CMAKE_FOLDER
+ /variable/CMAKE_FRAMEWORK
/variable/CMAKE_Fortran_FORMAT
/variable/CMAKE_Fortran_MODULE_DIRECTORY
/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE
diff --git a/Help/release/dev/CMAKE_FRAMEWORK.rst b/Help/release/dev/CMAKE_FRAMEWORK.rst
new file mode 100644
index 0000000..0253e04
--- /dev/null
+++ b/Help/release/dev/CMAKE_FRAMEWORK.rst
@@ -0,0 +1,6 @@
+CMAKE_FRAMEWORK
+---------------
+
+* A :variable:`CMAKE_FRAMEWORK` variable was added to
+ initialize the :prop_tgt:`FRAMEWORK` property on all
+ targets.
diff --git a/Help/variable/CMAKE_FRAMEWORK.rst b/Help/variable/CMAKE_FRAMEWORK.rst
new file mode 100644
index 0000000..591041c
--- /dev/null
+++ b/Help/variable/CMAKE_FRAMEWORK.rst
@@ -0,0 +1,7 @@
+CMAKE_FRAMEWORK
+---------------
+
+Default value for :prop_tgt:`FRAMEWORK` of targets.
+
+This variable is used to initialize the :prop_tgt:`FRAMEWORK` property on
+all the targets. See that target property for additional information.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2de8950..8b41e28 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -284,6 +284,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
InitProperty("RUNTIME_OUTPUT_DIRECTORY", nullptr);
InitProperty("PDB_OUTPUT_DIRECTORY", nullptr);
InitProperty("COMPILE_PDB_OUTPUT_DIRECTORY", nullptr);
+ InitProperty("FRAMEWORK", nullptr);
InitProperty("Fortran_FORMAT", nullptr);
InitProperty("Fortran_MODULE_DIRECTORY", nullptr);
InitProperty("Fortran_COMPILER_LAUNCHER", nullptr);
diff --git a/Tests/RunCMake/Framework/FrameworkLayout.cmake b/Tests/RunCMake/Framework/FrameworkLayout.cmake
index 4f42459..84012aa 100644
--- a/Tests/RunCMake/Framework/FrameworkLayout.cmake
+++ b/Tests/RunCMake/Framework/FrameworkLayout.cmake
@@ -11,8 +11,11 @@ add_library(Framework ${FRAMEWORK_TYPE}
flatresource.txt
deepresource.txt
some.txt)
+if("${CMAKE_FRAMEWORK}" STREQUAL "")
+ set_target_properties(Framework PROPERTIES
+ FRAMEWORK TRUE)
+endif()
set_target_properties(Framework PROPERTIES
- FRAMEWORK TRUE
PUBLIC_HEADER foo.h
RESOURCE "res.txt")
set_source_files_properties(flatresource.txt PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
diff --git a/Tests/RunCMake/Framework/RunCMakeTest.cmake b/Tests/RunCMake/Framework/RunCMakeTest.cmake
index e705a31..c7e1319 100644
--- a/Tests/RunCMake/Framework/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Framework/RunCMakeTest.cmake
@@ -20,11 +20,14 @@ framework_layout_test(iOSFrameworkLayout-build ios STATIC)
framework_layout_test(OSXFrameworkLayout-build osx SHARED)
framework_layout_test(OSXFrameworkLayout-build osx STATIC)
-function(framework_type_test Toolchain Type)
+function(framework_type_test Toolchain Type UseProperty)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${Toolchain}${Type}FrameworkType-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/${Toolchain}.cmake")
list(APPEND RunCMake_TEST_OPTIONS "-DFRAMEWORK_TYPE=${Type}")
+ if(NOT ${UseProperty})
+ list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_FRAMEWORK=YES")
+ endif()
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -33,7 +36,12 @@ function(framework_type_test Toolchain Type)
run_cmake_command(FrameworkType${Type}-build ${CMAKE_COMMAND} --build .)
endfunction()
-framework_type_test(ios SHARED)
-framework_type_test(ios STATIC)
-framework_type_test(osx SHARED)
-framework_type_test(osx STATIC)
+framework_type_test(ios SHARED NO)
+framework_type_test(ios STATIC NO)
+framework_type_test(osx SHARED NO)
+framework_type_test(osx STATIC NO)
+
+framework_type_test(ios SHARED YES)
+framework_type_test(ios STATIC YES)
+framework_type_test(osx SHARED YES)
+framework_type_test(osx STATIC YES)