summaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake/CMakeLists.txt
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-05-15 14:35:42 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-15 23:03:23 +0200
commitf16a77d78342acba9df2195dd20c9e2ce06a61ff (patch)
tree03a349df494d39a95d459cc16506b45a3b1ce694 /tests/auto/cmake/CMakeLists.txt
parent4f7a6bdabe1f0e73e9895ae8676449fda591718f (diff)
Use IF(NOT TARGET ...) before creating imported targets.
Initially we didn't do this because someone could accidentally create another target of a conflicting name, and used a variable to store whether we have created the target already or not. That wasn't adequeate to deal with finding the package in a scope like a function, so we used a directory property. However, the directory property is not valid in the same scopes as the defined target. For example, finding a Qt module in both a directory and a subdirectory causes a conflict. As it is already unlikely that a target would be accidentally created with a name like Qt5::Core, we should simply use the IF(TARGET) form. Change-Id: If64f25d45f51edcd1edb0d4bfb5ed3bb2479bd27 Reviewed-by: David Faure <faure@kde.org>
Diffstat (limited to 'tests/auto/cmake/CMakeLists.txt')
-rw-r--r--tests/auto/cmake/CMakeLists.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 64b2b8acec..40ceea1fc0 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -97,3 +97,4 @@ find_package(Qt5DBus QUIET)
if (Qt5DBus_FOUND AND NOT APPLE)
expect_pass(pass9)
endif()
+expect_pass(pass10)