diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c2e489a9e926d683737df2bf063cdd89ccc028c..65abed0367daf2f1c4248070d72d447a058651fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,10 +51,15 @@ else(OTB_FOUND) endif(OTB_FOUND) #---------------------------------------------------------------------------- -# Qt4 +# OpenGL (needed by Qt4) find_package( OpenGL REQUIRED ) + +#---------------------------------------------------------------------------- +# Qt4 +set(QT_USE_IMPORTED_TARGETS ON) find_package( Qt4 REQUIRED QtCore QtGui QtOpenGL QtMain QtXml ) include( ${QT_USE_FILE} ) +message( "${QT_QTOPENGL_LIBRARY}" ) #---------------------------------------------------------------------------- # Include OTB CMake modules path. diff --git a/Code/Application/Viewer/CMakeLists.txt b/Code/Application/Viewer/CMakeLists.txt index 66c1e61a6b2db6c1db6bbb0b9a24a01d68036010..476090456436b357ebd6e2db5901559bbcce39e3 100644 --- a/Code/Application/Viewer/CMakeLists.txt +++ b/Code/Application/Viewer/CMakeLists.txt @@ -75,15 +75,14 @@ endif() # The library is also used in tests, waiting for a better test strategy # The library is not installed -add_library(Monteverdi2_Application +add_library( Monteverdi2_Application STATIC ${Application_SOURCES} ${Application_FORMS_HEADERS} ${Application_SRC_MOC} ) -target_link_libraries(Monteverdi2_Application +target_link_libraries( Monteverdi2_Application Monteverdi2_Common - ${QT_LIBRARIES} ) ############################################################################# @@ -98,7 +97,6 @@ add_executable( mvd2-viewer target_link_libraries( mvd2-viewer Monteverdi2_Application Monteverdi2_Common - ${QT_LIBRARIES} ) deploy_qt_conf( mvd2-viewer ) diff --git a/Code/Common/CMakeLists.txt b/Code/Common/CMakeLists.txt index c6b17ade37e80309a0e8345cc76bf653897bea31..718da8f12c798af43f8a4a8c5b8f6f66061dc81d 100644 --- a/Code/Common/CMakeLists.txt +++ b/Code/Common/CMakeLists.txt @@ -111,6 +111,10 @@ target_link_libraries(Monteverdi2_Common OTBIO ${OPENGL_LIBRARIES} ${QT_LIBRARIES} + Qt4::QtCore + Qt4::QtGui + Qt4::QtOpenGL + Qt4::QtXml ) set_target_properties(Monteverdi2_Common