aboutsummaryrefslogtreecommitdiffhomepage
path: root/demos
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2012-10-31 11:36:45 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2012-10-31 11:36:45 +0100
commit691fb926904129c5a3884878240af5a2d92d1483 (patch)
tree290a3b109d1ca3321c93127f0c18a257aeae961d /demos
parentaa858cb43adf0ca33f8a2abd7ba5a0c1d86e8c06 (diff)
Disable opengl demo if Qt4 or OpenGL cannot be found.
Diffstat (limited to 'demos')
-rw-r--r--demos/opengl/CMakeLists.txt34
1 files changed, 21 insertions, 13 deletions
diff --git a/demos/opengl/CMakeLists.txt b/demos/opengl/CMakeLists.txt
index b98a30c01..299aa441d 100644
--- a/demos/opengl/CMakeLists.txt
+++ b/demos/opengl/CMakeLists.txt
@@ -1,20 +1,28 @@
-find_package(Qt4 REQUIRED)
-find_package(OpenGL REQUIRED)
+find_package(Qt4)
+find_package(OpenGL)
-set(QT_USE_QTOPENGL TRUE)
-include(${QT_USE_FILE})
+if(QT4_FOUND AND OPENGL_FOUND)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ set(QT_USE_QTOPENGL TRUE)
+ include(${QT_USE_FILE})
-include_directories( ${QT_INCLUDE_DIR} )
+ set(CMAKE_INCLUDE_CURRENT_DIR ON)
-set(quaternion_demo_SRCS gpuhelper.cpp icosphere.cpp camera.cpp trackball.cpp quaternion_demo.cpp)
+ include_directories( ${QT_INCLUDE_DIR} )
-qt4_automoc(${quaternion_demo_SRCS})
+ set(quaternion_demo_SRCS gpuhelper.cpp icosphere.cpp camera.cpp trackball.cpp quaternion_demo.cpp)
-add_executable(quaternion_demo ${quaternion_demo_SRCS})
-add_dependencies(demos quaternion_demo)
+ qt4_automoc(${quaternion_demo_SRCS})
-target_link_libraries(quaternion_demo
- ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}
- ${QT_QTOPENGL_LIBRARY} ${OPENGL_LIBRARIES} )
+ 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() \ No newline at end of file