[Cmake-commits] CMake branch, next, updated. v2.8.10.2-1336-gd06a031
Stephen Kelly
steveire at gmail.com
Tue Jan 1 12:11:13 EST 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via d06a0317685fa9f922062ff6fc521951d970a2b9 (commit)
via 0f9f684247e345cb807ecc4f656201520b7aec56 (commit)
from f178058c9b7f7d8fc046c6d1b325538cf67c0329 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d06a0317685fa9f922062ff6fc521951d970a2b9
commit d06a0317685fa9f922062ff6fc521951d970a2b9
Merge: f178058 0f9f684
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jan 1 12:11:11 2013 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jan 1 12:11:11 2013 -0500
Merge topic 'qt4-target-depends' into next
0f9f684 Add Qt module dependencies to the IMPORTED targets.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0f9f684247e345cb807ecc4f656201520b7aec56
commit 0f9f684247e345cb807ecc4f656201520b7aec56
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Dec 31 09:41:09 2012 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Dec 31 09:44:01 2012 +0100
Add Qt module dependencies to the IMPORTED targets.
This means for example, that consumers can use:
target_link_libraries(foo ${QT_QTGUI_LIBRARIES})
instead of also needing to specify all 'public' dependencies:
target_link_libraries(foo ${QT_QTGUI_LIBRARIES} ${QT_QTCORE_LIBRARIES} )
when using the IMPORTED targets.
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index ea4d8f4..4a176e5 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -942,12 +942,27 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
############################################
+ macro(_qt4_add_target_depends _QT_MODULE)
+ if (TARGET Qt4::${_QT_MODULE})
+ foreach(_DEPEND ${ARGN})
+ if (NOT TARGET Qt4::Qt${_DEPEND})
+ message(FATAL_ERROR "_qt4_add_target_depends invoked with invalid arguments")
+ endif()
+ set_property(TARGET Qt4::${_QT_MODULE} APPEND PROPERTY
+ IMPORTED_LINK_INTERFACE_LIBRARIES
+ "Qt4::Qt${_DEPEND}"
+ )
+ endforeach()
+ endif()
+ endmacro()
+
# Set QT_xyz_LIBRARY variable and add
# library include path to QT_INCLUDES
_QT4_ADJUST_LIB_VARS(QtCore)
foreach(QT_MODULE ${QT_MODULES})
_QT4_ADJUST_LIB_VARS(${QT_MODULE})
+ _qt4_add_target_depends(${QT_MODULE} Core)
endforeach()
_QT4_ADJUST_LIB_VARS(QtAssistant)
@@ -962,6 +977,19 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
_QT4_ADJUST_LIB_VARS(QAxContainer)
endif()
+ # Only public dependencies are listed here.
+ # Eg, QtDBus links to QtXml, but users of QtDBus do not need to
+ # link to QtXml because QtDBus only uses it internally, not in public
+ # headers.
+ # Everything depends on QtCore, but that is covered above already
+ _qt4_add_target_depends(Qt3Support Sql Gui Network)
+ _qt4_add_target_depends(QtDeclarative Script Gui)
+ _qt4_add_target_depends(QtDesigner Gui)
+ _qt4_add_target_depends(QtHelp Gui)
+ _qt4_add_target_depends(QtMultimedia Gui)
+ _qt4_add_target_depends(QtOpenGL Gui)
+ _qt4_add_target_depends(QtSvg Gui)
+ _qt4_add_target_depends(QtWebKit Gui Network)
#######################################
#
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index f443b5b..2dd7d8b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -989,6 +989,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomoc")
endif()
+ if(QT4_WORKS AND QT_QTDECLARATIVE_FOUND)
+ add_test(Qt4Targets ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/Qt4Targets"
+ "${CMake_BINARY_DIR}/Tests/Qt4Targets"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project Qt4Targets
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Targets"
+ --force-new-ctest-process
+ --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+ --test-command ${CMAKE_CTEST_COMMAND} -V
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Targets")
+ endif()
add_test(ExternalProject ${CMAKE_CTEST_COMMAND}
--build-and-test
diff --git a/Tests/Qt4Targets/CMakeLists.txt b/Tests/Qt4Targets/CMakeLists.txt
new file mode 100644
index 0000000..caf04e0
--- /dev/null
+++ b/Tests/Qt4Targets/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(Qt4Targets)
+
+find_package(Qt4 REQUIRED)
+
+include_directories(${QT_INCLUDES})
+
+add_executable(Qt4Targets WIN32 main.cpp)
+target_link_libraries(Qt4Targets Qt4::QtDeclarative)
+
+if (WIN32)
+ target_link_libraries(Qt4Targets Qt4::qtmain)
+endif()
diff --git a/Tests/Qt4Targets/main.cpp b/Tests/Qt4Targets/main.cpp
new file mode 100644
index 0000000..f14882d
--- /dev/null
+++ b/Tests/Qt4Targets/main.cpp
@@ -0,0 +1,17 @@
+
+#include <QApplication>
+
+#include <QDeclarativeView>
+
+#include <QUrl>
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ QDeclarativeView v;
+ v.setSource(QUrl("http://www.example.com"));
+ v.show();
+
+ return 0;
+}
-----------------------------------------------------------------------
Summary of changes:
Modules/FindQt4.cmake | 28 ++++++++++++++++++++++++++++
Tests/CMakeLists.txt | 15 +++++++++++++++
Tests/Qt4Targets/CMakeLists.txt | 14 ++++++++++++++
Tests/Qt4Targets/main.cpp | 17 +++++++++++++++++
4 files changed, 74 insertions(+), 0 deletions(-)
create mode 100644 Tests/Qt4Targets/CMakeLists.txt
create mode 100644 Tests/Qt4Targets/main.cpp
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list