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>
This commit is contained in:
parent
49c743bdb9
commit
000c4358ce
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user