diff options
author | Kevin Funk <kevin.funk@kdab.com> | 2016-01-08 15:58:16 +0100 |
---|---|---|
committer | Kevin Funk <kfunk@kde.org> | 2016-01-09 15:35:20 +0000 |
commit | 000c4358ceca78dc962a8ac287afdbb54e8b9837 (patch) | |
tree | 52476a7bc309389084aecc173393b138f2639295 /tests | |
parent | 49c743bdb972587e03944b68aa0290650163c5b1 (diff) |
CMake: Make all tests link to Qt libraries
This is needed as of commit v5.6.0-beta1~483 (Add an automatic use of
the ELF-versioned QtCore symbol, 2015-10-20). Even if a translation
unit only contains
#include <QtCore/QString>
int main(int,char**)
{
return 0;
}
it must link to QtCore which provides the qt_version_tag symbol.
Change-Id: I827c0a7403320e7e5b384d8608face20fcecdaea
Reviewed-by: Stephen Kelly <ske@ableton.com>
Diffstat (limited to 'tests')
3 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt b/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt index c0fdfd6b9a..6b11c09e7b 100644 --- a/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt +++ b/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt @@ -9,5 +9,5 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") add_subdirectory(subdir1) -add_executable(exe1 "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp") -include_directories(${Qt5Core_INCLUDE_DIRS}) +add_executable(exe1 main.cpp) +target_link_libraries(exe1 Qt5::Core) diff --git a/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt b/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt index 0c7a113f50..dfcc35d735 100644 --- a/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt +++ b/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt @@ -2,4 +2,4 @@ find_package(Qt5Core REQUIRED) add_executable(exe2 "${CMAKE_CURRENT_SOURCE_DIR}/../main.cpp") -include_directories(${Qt5Core_INCLUDE_DIRS}) +target_link_libraries(exe2 Qt5::Core) diff --git a/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt b/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt index 2b32a419e7..e2f72842f6 100644 --- a/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt +++ b/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt @@ -11,3 +11,4 @@ add_definitions(${Qt5Core_DEFINITIONS}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") add_executable(myobject main.cpp) +target_link_libraries(myobject Qt5::Core) |