root/OpenSceneGraph/trunk/examples/osgviewerQt/CMakeLists.txt @ 13482

Revision 13482, 0.7 kB (checked in by robert, 3 hours ago)

From Mattias Helsing, "Seems I was only half right given what you asked for. CMP0017 only
says that modules that are found and ran from cmake modules dir should
prefer cmake-provided modules. find_package() and include() still look
in CMAKE_MODULE_PATH first.

After some investigating I've come up with a proposal examplified in
the attached FindGDAL.cmake script. It simply calls the cmake provided
FindGDAL.cmake if it exists and returns if it succeeds in finding GDAL
using that, otherwise continue with our local cmake code.
Pro: Wont clutter our root CMakeLists.txt
Con: If we begin to write more advanced Findxxx modules (using
COMPONENTS, REQUIRED etc.) we may have to revise this scheme.
"

  • Property svn:eol-style set to native
Line 
1SET( TARGET_SRC
2    osgviewerQt.cpp
3)
4
5IF ( NOT Qt5Widgets_FOUND )
6    IF( QT4_FOUND )
7    SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY_RELEASE} ${QT_QTGUI_LIBRARY_RELEASE}
8        ${QT_QTOPENGL_LIBRARY_RELEASE} )
9    ADD_DEFINITIONS(-DUSE_QT4)
10    ELSE( QT4_FOUND )
11    SET(TARGET_EXTERNAL_LIBRARIES ${QT_LIBRARIES} )
12    ENDIF( QT4_FOUND )
13
14    INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR}
15             ${QT_QTOPENGL_INCLUDE_DIR} )
16ENDIF()
17
18SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
19
20SET( EXAMPLE_NAME osgviewerQt )
21
22SETUP_EXAMPLE( ${EXAMPLE_NAME} )
23
24IF ( Qt5Widgets_FOUND )
25    qt5_use_modules( example_${EXAMPLE_NAME} Widgets OpenGL )
26ENDIF( Qt5Widgets_FOUND )
27
Note: See TracBrowser for help on using the browser.