Making the building of demo programs optional, but enabled by default per e-mail...
authorJohn F. Fay <johnffay@nettally.com>
Tue, 10 Jan 2012 02:01:19 +0000 (02:01 +0000)
committerJohn F. Fay <johnffay@nettally.com>
Tue, 10 Jan 2012 02:01:19 +0000 (02:01 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@974 7f0cb862-5218-0410-a997-914c9d46530a

CMakeLists.txt

index 12cc9ff..c25947c 100644 (file)
@@ -93,10 +93,15 @@ INSTALL(TARGETS freeglut DESTINATION lib)
 INSTALL(DIRECTORY "${CMAKE_SOURCE_DIR}/include/GL" DESTINATION include\r
                FILES_MATCHING PATTERN "*.h")\r
 \r
+# Optionally build demos, on by default.\r
+option( FREEGLUT_BUILD_DEMOS "Build FreeGLUT demos." ON )\r
+\r
 MACRO(ADD_DEMO name)\r
-       ADD_EXECUTABLE(${name} ${ARGN})\r
-       TARGET_LINK_LIBRARIES(${name} freeglut)\r
-       INSTALL(TARGETS ${name} DESTINATION bin)\r
+       if( FREEGLUT_BUILD_DEMOS )\r
+               ADD_EXECUTABLE(${name} ${ARGN})\r
+               TARGET_LINK_LIBRARIES(${name} freeglut)\r
+               INSTALL(TARGETS ${name} DESTINATION bin)\r
+       endif()\r
 ENDMACRO()\r
 \r
 ADD_DEMO(CallbackMaker   progs/demos/CallbackMaker/CallbackMaker.c)\r