summaryrefslogtreecommitdiffstats
path: root/Tests/Properties/SubDir2
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-04-24 15:42:14 (GMT)
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-05-14 14:31:22 (GMT)
commit3d4b70ea6474c8f29d6b5c057126582dcaad7ea7 (patch)
treed683c5a91d360982f740645dc45765b3b9d52089 /Tests/Properties/SubDir2
parent4dc95526868d903c7f9e9505001cb5dbeec259c0 (diff)
downloadCMake-3d4b70ea6474c8f29d6b5c057126582dcaad7ea7.zip
CMake-3d4b70ea6474c8f29d6b5c057126582dcaad7ea7.tar.gz
CMake-3d4b70ea6474c8f29d6b5c057126582dcaad7ea7.tar.bz2
set_source_files_properties: Allow specification of directory scope
Both set_source_files_properties() and set_property(SOURCE) now accept two new optional arguments: DIRECTORY and TARGET_DIRECTORY. The DIRECTORY option takes a list of relative or absolute paths pointing to processed source directories (add_subdirectory was already called on them). These paths specify directory scopes where the source file properties will be set. Previously the scope was always the currently processed source directory. Similarly TARGET_DIRECTORY takes a list of targets, whose source directories will be used as the list of scopes where to set the source file properties. get_property() and get_source_file_property() also get the same new arguments, except only one value can be specified instead of a list. Fixes: #20128
Diffstat (limited to 'Tests/Properties/SubDir2')
-rw-r--r--Tests/Properties/SubDir2/CMakeLists.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/Tests/Properties/SubDir2/CMakeLists.txt b/Tests/Properties/SubDir2/CMakeLists.txt
index 377dc83..9b2c79e 100644
--- a/Tests/Properties/SubDir2/CMakeLists.txt
+++ b/Tests/Properties/SubDir2/CMakeLists.txt
@@ -3,3 +3,28 @@ set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/../subdirtest.cxx"
PROPERTIES COMPILE_DEFINITIONS SUBDIR_TEST)
add_executable(subdirtest "${CMAKE_CURRENT_SOURCE_DIR}/../subdirtest.cxx")
+
+# For set_property
+add_library(set_prop_lib_1 SHARED)
+foreach(i RANGE 1 6)
+ generate_file_for_set_property_test(${i} set_prop_lib_1)
+endforeach()
+
+# For set_source_files_properties
+foreach(i RANGE 10 12)
+ generate_file_for_set_property_test(${i} set_prop_lib_1)
+endforeach()
+
+# For set_source_files_properties + multiple files + absolute directory path
+add_library(set_prop_lib_2 SHARED)
+foreach(i RANGE 20 21)
+ generate_file_for_set_property_test(${i} set_prop_lib_1)
+endforeach()
+
+# For set_source_files_properties + multiple files + multiple target directories
+add_library(set_prop_lib_3 SHARED)
+generate_file_for_set_property_test(22 set_prop_lib_2)
+generate_file_for_set_property_test(23 set_prop_lib_3)
+
+# For set_source_files_properties + multiple files in multiple directories
+generate_file_for_set_property_test(31 set_prop_lib_3)