Revert "Don't use the pri depends line for link dependencies."
This reverts commit df43b9a06a
.
Using the same depends information as QMake provides adds a lot of
convenience for users, and is mostly 'correct' from a CMake
point of view anyway.
Change-Id: I8f2a2f74a687c25a0dedcc491ef72ddb5b136090
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
parent
4d4975c3d0
commit
b4dabb9e50
@ -17,6 +17,10 @@ defineReplace(cmakeModuleList) {
|
||||
|
||||
CMAKE_MODULE_NAME = $$cmakeModuleName($${MODULE})
|
||||
|
||||
CMAKE_MODULE_DEPS = $$cmakeModuleList($$eval(QT.$${MODULE}.depends))
|
||||
CMAKE_PARTIAL_MODULE_DEPS = $$replace(CMAKE_MODULE_DEPS, ";", ";Qt5::")
|
||||
!isEmpty(CMAKE_PARTIAL_MODULE_DEPS):CMAKE_QT5_MODULE_DEPS = "Qt5::$${CMAKE_PARTIAL_MODULE_DEPS}"
|
||||
|
||||
CMAKE_QT_INSTALL_PREFIX = $$replace($$list($$[QT_INSTALL_PREFIX]), \\\\, /)/
|
||||
CMAKE_QT_INSTALL_PREFIX_ESCAPED = "^$$re_escape($$CMAKE_QT_INSTALL_PREFIX)"
|
||||
|
||||
|
@ -85,8 +85,7 @@ else()
|
||||
message("CMake version older than 2.8.7 (Found ${CMAKE_VERSION}). Not running test \"pass1\"")
|
||||
endif()
|
||||
expect_pass(pass2)
|
||||
# Modules do not currently find their own dependencies.
|
||||
# expect_pass(pass3)
|
||||
expect_pass(pass3)
|
||||
expect_fail(fail4)
|
||||
expect_fail(fail5)
|
||||
expect_pass("pass(needsquoting)6")
|
||||
|
@ -9,14 +9,14 @@ find_package(Qt5Widgets REQUIRED)
|
||||
|
||||
include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
|
||||
|
||||
add_definitions(${Qt5Core_DEFINITIONS} ${Qt5Gui_DEFINITIONS} ${Qt5Widgets_DEFINITIONS})
|
||||
add_definitions(${Qt5Core_DEFINITIONS})
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
qt5_wrap_cpp(moc_files mywidget.h)
|
||||
qt5_wrap_ui(ui_files mywidget.ui)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
||||
|
||||
add_executable(mywidget mywidget.cpp ${moc_files} ${ui_files})
|
||||
target_link_libraries(mywidget ${Qt5Widgets_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Core_LIBRARIES})
|
||||
target_link_libraries(mywidget ${Qt5Widgets_LIBRARIES})
|
||||
|
@ -43,9 +43,6 @@ endmacro()
|
||||
add_executable(two two.cpp)
|
||||
add_executable(three three.cpp)
|
||||
|
||||
qt5_use_package(two Core)
|
||||
qt5_use_package(two Test)
|
||||
qt5_use_package(three Widgets)
|
||||
qt5_use_package(three Gui)
|
||||
qt5_use_package(three Core)
|
||||
qt5_use_package(three Test)
|
||||
|
Loading…
Reference in New Issue
Block a user