diff options
author | Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk> | 2012-04-04 17:36:37 -0300 |
---|---|---|
committer | Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk> | 2012-04-04 17:36:37 -0300 |
commit | f87b7484d122f5f6cd027267fd5707d03758078a (patch) | |
tree | 794641d766e4f5fa209da140c46a55c870955729 /cmake | |
parent | 7e993408ddaf5ead064f86a5cfe59f1be3a93329 (diff) |
Properly build against Qt 5 alpha.
Qt 5 alpha release has some build issues that should be addressed in order to build tp-qt against
it:
- When running configure in Qt 5 alpha, the pkgconfig files are properly generated, but when make is
executed, the files are replaced with empty ones, so to build tp-qt one must either backup the pkgconfig
files generated during the configure phase before running make and replace them afterwards,
or re-run configure with the same parameters after building it. (reported and should be fixed when
beta is out)
- If Qt 5 alpha is built with -reduce-relocations enabled, one must add the keyword
"reduce_relocations" to qtbase/lib/pkgconfig/QtCore.pc in the qt_config section, so that tp-qt knows
when to use -fPIC/PIE accordingly. (reported and should be fixed when beta is out)
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindQt5.cmake | 9 | ||||
-rw-r--r-- | cmake/modules/TpQtMacros.cmake | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/cmake/modules/FindQt5.cmake b/cmake/modules/FindQt5.cmake index 1957f604..fb300544 100644 --- a/cmake/modules/FindQt5.cmake +++ b/cmake/modules/FindQt5.cmake @@ -44,7 +44,8 @@ # QT_QTXML_LIBRARY The QtXml library # # also defined, but NOT for general use are -# QT_MOC_EXECUTABLE Where to find the moc tool. +# QT_MOC_EXECUTABLE Where to find the moc tool +# QT_CONFIG_FLAGS Flags used when building Qt # Copyright (C) 2001-2009 Kitware, Inc. # Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/> @@ -151,6 +152,12 @@ MARK_AS_ADVANCED(QT_INCLUDES QT_INCLUDE_DIR QT_DOC_DIR QT_QMAKE_EXECUTABLE_FINDQT QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE) +# Invokes pkgconfig, cleans up the result and sets variables +EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable qt_config QtCore + OUTPUT_VARIABLE _pkgconfig_flags + RESULT_VARIABLE _pkgconfig_failed) +STRING(REPLACE " " ";" QT_CONFIG_FLAGS "${_pkgconfig_flags}") + INCLUDE(Qt5Macros) SET(QT_FOUND TRUE) diff --git a/cmake/modules/TpQtMacros.cmake b/cmake/modules/TpQtMacros.cmake index 57779175..83133ee2 100644 --- a/cmake/modules/TpQtMacros.cmake +++ b/cmake/modules/TpQtMacros.cmake @@ -403,7 +403,7 @@ endfunction(tpqt_types_gen _TARGET_NAME _SPEC_XML _OUTFILE_DECL _OUTFILE_IMPL _N macro(tpqt_add_generic_unit_test _fancyName _name) tpqt_generate_moc_i(${_name}.cpp ${CMAKE_CURRENT_BINARY_DIR}/_gen/${_name}.cpp.moc.hpp) add_executable(test-${_name} ${_name}.cpp ${CMAKE_CURRENT_BINARY_DIR}/_gen/${_name}.cpp.moc.hpp) - target_link_libraries(test-${_name} ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTTEST_LIBRARY} telepathy-qt${QT_VERSION_MAJOR} tp-qt-tests ${ARGN}) + target_link_libraries(test-${_name} ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTTEST_LIBRARY} telepathy-qt${QT_VERSION_MAJOR} tp-qt-tests ${TP_QT_EXECUTABLE_LINKER_FLAGS} ${ARGN}) add_test(${_fancyName} ${SH} ${CMAKE_CURRENT_BINARY_DIR}/runGenericTest.sh ${CMAKE_CURRENT_BINARY_DIR}/test-${_name}) list(APPEND _telepathy_qt_test_cases test-${_name}) @@ -414,7 +414,7 @@ endmacro(tpqt_add_generic_unit_test _fancyName _name) macro(tpqt_add_dbus_unit_test _fancyName _name) tpqt_generate_moc_i(${_name}.cpp ${CMAKE_CURRENT_BINARY_DIR}/_gen/${_name}.cpp.moc.hpp) add_executable(test-${_name} ${_name}.cpp ${CMAKE_CURRENT_BINARY_DIR}/_gen/${_name}.cpp.moc.hpp) - target_link_libraries(test-${_name} ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTTEST_LIBRARY} telepathy-qt${QT_VERSION_MAJOR} tp-qt-tests ${ARGN}) + target_link_libraries(test-${_name} ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTTEST_LIBRARY} telepathy-qt${QT_VERSION_MAJOR} tp-qt-tests ${TP_QT_EXECUTABLE_LINKER_FLAGS} ${ARGN}) set(with_session_bus ${CMAKE_CURRENT_BINARY_DIR}/runDbusTest.sh) add_test(${_fancyName} ${SH} ${with_session_bus} ${CMAKE_CURRENT_BINARY_DIR}/test-${_name}) list(APPEND _telepathy_qt_test_cases test-${_name}) |