Make modules find their own dependencies.
Change-Id: I4a7b96d33417a15d79f3932ced91bee58915c83f Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
parent
657038ca30
commit
008a1573af
@ -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 \"\")
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user