From: Stephen Kelly Date: Tue, 10 Jan 2012 04:30:31 +0000 (+0100) Subject: Make modules find their own dependencies. X-Git-Tag: qt-v5.0.0-alpha1~1901 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=008a1573af06b8e5e6e7a212feecd9ba35731e81;p=profile%2Fivi%2Fqtbase.git Make modules find their own dependencies. Change-Id: I4a7b96d33417a15d79f3932ced91bee58915c83f Reviewed-by: Alexander Neundorf Reviewed-by: Stephen Kelly --- diff --git a/mkspecs/cmake/Qt5BasicConfig.cmake.in b/mkspecs/cmake/Qt5BasicConfig.cmake.in index 2c8cd17..77d1f5d 100644 --- a/mkspecs/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/cmake/Qt5BasicConfig.cmake.in @@ -14,6 +14,18 @@ set(Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS QT_\${_CMAKE_MODULE_NAME_UPPER} set(_Qt5_MODULE_DEPENDENCIES \"$${CMAKE_MODULE_DEPS}\") +foreach(_module_dep ${_Qt5_MODULE_DEPENDENCIES}) + if (NOT Qt5${_module_dep}_FOUND) + find_package(Qt5${_module_dep} REQUIRED) + endif() + list(APPEND Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS ${Qt5${_module_dep}_INCLUDE_DIRS}) + list(APPEND Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS ${Qt5${_module_dep}_DEFINITIONS}) + list(APPEND Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS ${Qt5${_module_dep}_COMPILE_DEFINITIONS}) +endforeach() +list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS) +list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS) +list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS) + if (NOT _Qt5$${CMAKE_MODULE_NAME}_target) set(_Qt5$${CMAKE_MODULE_NAME}_target 1) if (\"$${CMAKE_STATIC_TYPE}\" STREQUAL \"\") diff --git a/tests/manual/cmake/pass3/CMakeLists.txt b/tests/manual/cmake/pass3/CMakeLists.txt index 8c39b4f..11402e2 100644 --- a/tests/manual/cmake/pass3/CMakeLists.txt +++ b/tests/manual/cmake/pass3/CMakeLists.txt @@ -3,11 +3,10 @@ cmake_minimum_required(VERSION 2.8) project(pass3) -find_package(Qt5Core REQUIRED) -find_package(Qt5Gui REQUIRED) +# The module finds its dependencies find_package(Qt5Widgets REQUIRED) -include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}) +include_directories(${Qt5Widgets_INCLUDE_DIRS}) set(CMAKE_INCLUDE_CURRENT_DIR ON)