2012-10-31 18:36:45 +08:00
|
|
|
find_package(Qt4)
|
|
|
|
find_package(OpenGL)
|
2008-09-08 07:15:11 +08:00
|
|
|
|
2012-10-31 18:36:45 +08:00
|
|
|
if(QT4_FOUND AND OPENGL_FOUND)
|
2008-09-08 07:15:11 +08:00
|
|
|
|
2012-10-31 18:36:45 +08:00
|
|
|
set(QT_USE_QTOPENGL TRUE)
|
|
|
|
include(${QT_USE_FILE})
|
2008-09-08 07:15:11 +08:00
|
|
|
|
2012-10-31 18:36:45 +08:00
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
2008-09-08 07:15:11 +08:00
|
|
|
|
2012-10-31 18:36:45 +08:00
|
|
|
include_directories( ${QT_INCLUDE_DIR} )
|
2008-09-08 07:15:11 +08:00
|
|
|
|
2012-10-31 18:36:45 +08:00
|
|
|
set(quaternion_demo_SRCS gpuhelper.cpp icosphere.cpp camera.cpp trackball.cpp quaternion_demo.cpp)
|
2008-09-08 07:15:11 +08:00
|
|
|
|
2012-10-31 18:36:45 +08:00
|
|
|
qt4_automoc(${quaternion_demo_SRCS})
|
2008-09-08 07:15:11 +08:00
|
|
|
|
2012-10-31 18:36:45 +08:00
|
|
|
add_executable(quaternion_demo ${quaternion_demo_SRCS})
|
|
|
|
add_dependencies(demos quaternion_demo)
|
|
|
|
|
|
|
|
target_link_libraries(quaternion_demo
|
|
|
|
${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}
|
|
|
|
${QT_QTOPENGL_LIBRARY} ${OPENGL_LIBRARIES} )
|
|
|
|
|
|
|
|
else()
|
|
|
|
|
|
|
|
message(STATUS "OpenGL demo disabled because Qt4 and/or OpenGL have not been found.")
|
|
|
|
|
|
|
|
endif()
|