1find_package(Qt4) 2find_package(OpenGL) 3 4if(QT4_FOUND AND OPENGL_FOUND) 5 6 set(QT_USE_QTOPENGL TRUE) 7 include(${QT_USE_FILE}) 8 9 set(CMAKE_INCLUDE_CURRENT_DIR ON) 10 11 include_directories( ${QT_INCLUDE_DIR} ) 12 13 set(quaternion_demo_SRCS gpuhelper.cpp icosphere.cpp camera.cpp trackball.cpp quaternion_demo.cpp) 14 15 qt4_automoc(${quaternion_demo_SRCS}) 16 17 add_executable(quaternion_demo ${quaternion_demo_SRCS}) 18 add_dependencies(demos quaternion_demo) 19 20 target_link_libraries(quaternion_demo 21 ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} 22 ${QT_QTOPENGL_LIBRARY} ${OPENGL_LIBRARIES} ) 23 24else() 25 26 message(STATUS "OpenGL demo disabled because Qt4 and/or OpenGL have not been found.") 27 28endif()