Marie-Christine Vallet wrote:

why do I have to include and link qt_dir and qt_libs when I set this variable ?

SET ( QT_USE_OPENGL TRUE )


INCLUDE_DIRECTORIES (
                      ${CMAKE_CURRENT_BINARY_DIR}
                     ${QT_INCLUDE_DIR}
                     ${QT_QTOPENGL_INCLUDE_DIR}

                   )

TARGET_LINK_LIBRARIES ( mdi
                       ${QT_LIBRARIES}
                       ${QT_QTOPENGL_LIBRARIES}
                       ${QGLVIEWER_LIBRARY}
                     )

You could also do this, QT_USE_FILE aka UseQt4.cmake will include all your Qt libraries and setup the QT_LIBRARIES variable so that it will contain all your Qt libs. It doesn't save a ton of space when you are using one Qt library, but it pays off when you start using more.

SET ( QT_USE_OPENGL TRUE )
INCLUDE ( ${QT_USE_FILE} )

INCLUDE_DIRECTORIES (
        ${CMAKE_CURRENT_BINARY_DIR}
        )

TARGET_LINK_LIBRARIES ( mdi
        ${QT_LIBRARIES}
        ${QGLVIEWER_LIBRARY}
        )

--
Daniel

_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to