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. Also populate the IMPORTED_LINK_DEPENDENT_LIBRARIES property so CMake can help the linker find shared library dependencies.
15 lines
278 B
CMake
15 lines
278 B
CMake
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::QtGui)
|
|
|
|
if (WIN32)
|
|
target_link_libraries(Qt4Targets Qt4::qtmain)
|
|
endif()
|