summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorRoland Hieber <r.hieber@pengutronix.de>2017-11-08 08:22:01 +0100
committerAlbert Astals Cid <aacid@kde.org>2017-11-08 08:22:01 +0100
commit6ae4293fce77290f4fbdc643c999809d5924bf2c (patch)
tree7fb9b7c072fbefa56a6510d6cc1ef237838fe372 /cmake
parentaaa9c5308766a88d0512b87051d7c7082f152a9f (diff)
CMake: add the custom buildtests target only once
Make BUILDTESTS_ADDED a global property, so the `buildtests` target gets added only once. As far as I understood, this seems to fulfil the requirements of CMP0002. Bug #103003
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/PopplerMacros.cmake8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
index aa5ca6de..ccb27904 100644
--- a/cmake/modules/PopplerMacros.cmake
+++ b/cmake/modules/PopplerMacros.cmake
@@ -13,10 +13,10 @@ macro(POPPLER_ADD_TEST exe build_flag)
# if the tests are EXCLUDE_FROM_ALL, add a target "buildtests" to build all tests
if(NOT build_test AND NOT MSVC_IDE)
- get_directory_property(_buildtestsAdded BUILDTESTS_ADDED)
+ get_property(_buildtestsAdded GLOBAL PROPERTY BUILDTESTS_ADDED)
if(NOT _buildtestsAdded)
add_custom_target(buildtests)
- set_directory_properties(PROPERTIES BUILDTESTS_ADDED TRUE)
+ set_property(GLOBAL PROPERTY BUILDTESTS_ADDED TRUE)
endif(NOT _buildtestsAdded)
add_dependencies(buildtests ${exe})
endif(NOT build_test AND NOT MSVC_IDE)
@@ -33,10 +33,10 @@ macro(POPPLER_ADD_UNITTEST exe build_flag)
# if the tests are EXCLUDE_FROM_ALL, add a target "buildtests" to build all tests
if(NOT build_test)
- get_directory_property(_buildtestsAdded BUILDTESTS_ADDED)
+ get_property(_buildtestsAdded GLOBAL PROPERTY BUILDTESTS_ADDED)
if(NOT _buildtestsAdded)
add_custom_target(buildtests)
- set_directory_properties(PROPERTIES BUILDTESTS_ADDED TRUE)
+ set_property(GLOBAL PROPERTY BUILDTESTS_ADDED TRUE)
endif(NOT _buildtestsAdded)
add_dependencies(buildtests ${exe})
endif(NOT build_test)