Commit c1aa487b authored by Julien Malik's avatar Julien Malik
Browse files

COMP: use Qt imported targets for better isolation in target_link_libraries

parent 969a6886
...@@ -51,10 +51,15 @@ else(OTB_FOUND) ...@@ -51,10 +51,15 @@ else(OTB_FOUND)
endif(OTB_FOUND) endif(OTB_FOUND)
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Qt4 # OpenGL (needed by Qt4)
find_package( OpenGL REQUIRED ) find_package( OpenGL REQUIRED )
#----------------------------------------------------------------------------
# Qt4
set(QT_USE_IMPORTED_TARGETS ON)
find_package( Qt4 REQUIRED QtCore QtGui QtOpenGL QtMain QtXml ) find_package( Qt4 REQUIRED QtCore QtGui QtOpenGL QtMain QtXml )
include( ${QT_USE_FILE} ) include( ${QT_USE_FILE} )
message( "${QT_QTOPENGL_LIBRARY}" )
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Include OTB CMake modules path. # Include OTB CMake modules path.
......
...@@ -75,15 +75,14 @@ endif() ...@@ -75,15 +75,14 @@ endif()
# The library is also used in tests, waiting for a better test strategy # The library is also used in tests, waiting for a better test strategy
# The library is not installed # The library is not installed
add_library(Monteverdi2_Application add_library( Monteverdi2_Application
STATIC STATIC
${Application_SOURCES} ${Application_SOURCES}
${Application_FORMS_HEADERS} ${Application_FORMS_HEADERS}
${Application_SRC_MOC} ${Application_SRC_MOC}
) )
target_link_libraries(Monteverdi2_Application target_link_libraries( Monteverdi2_Application
Monteverdi2_Common Monteverdi2_Common
${QT_LIBRARIES}
) )
############################################################################# #############################################################################
...@@ -98,7 +97,6 @@ add_executable( mvd2-viewer ...@@ -98,7 +97,6 @@ add_executable( mvd2-viewer
target_link_libraries( mvd2-viewer target_link_libraries( mvd2-viewer
Monteverdi2_Application Monteverdi2_Application
Monteverdi2_Common Monteverdi2_Common
${QT_LIBRARIES}
) )
deploy_qt_conf( mvd2-viewer ) deploy_qt_conf( mvd2-viewer )
......
...@@ -111,6 +111,10 @@ target_link_libraries(Monteverdi2_Common ...@@ -111,6 +111,10 @@ target_link_libraries(Monteverdi2_Common
OTBIO OTBIO
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
${QT_LIBRARIES} ${QT_LIBRARIES}
Qt4::QtCore
Qt4::QtGui
Qt4::QtOpenGL
Qt4::QtXml
) )
set_target_properties(Monteverdi2_Common set_target_properties(Monteverdi2_Common
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment