aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-01-30 13:33:32 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-01-30 13:29:30 +0000
commitc99aa3447bffcd8c222566a7c22b9627c5a52c59 (patch)
treea366cd4d85deca4d9da417bfc0648e18efc22df2
parent9d23904f5d5f13f8e6f72deebefff1d336163ff8 (diff)
Prepare repo for CMake super project buildv5.12.3v5.12.2
When doing a super project build (root CMake file builds shiboken2, pyside2 and pyside2-tools), there can only be one uninstall target defined. Make sure not to redefine it if it was already defined. Also there is no point in doing find_package(Shiboken2) twice, given that the parent scope of the project already does it. Change-Id: If8c4cf9e9265632ad29e1dd73d19e6f5cc13ea7f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--CMakeLists.txt8
-rw-r--r--tests/CMakeLists.txt1
2 files changed, 6 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2aa79d6..4d0d9f9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,8 +67,12 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
-add_custom_target(uninstall "${CMAKE_COMMAND}"
- -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
+# When opening super project, prevent redefinition of uninstall target.
+if (NOT TARGET uninstall)
+ add_custom_target(uninstall "${CMAKE_COMMAND}"
+ -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
+endif()
+
# Does not work with ninja on Win32.
if (NOT (WIN32 AND CMAKE_GENERATOR STREQUAL "Ninja"))
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index c2da412..25a9cb7 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,4 +1,3 @@
-find_package(Shiboken2 2.0.0 REQUIRED)
add_subdirectory(rcc)
add_test(QWizard ${SHIBOKEN_PYTHON_INTERPRETER} ${CMAKE_SOURCE_DIR}/pyside2-uic "${CMAKE_CURRENT_SOURCE_DIR}/qwizard_test.ui")
set_tests_properties(QWizard PROPERTIES