From b11681a3aba32e03e4763f7801abb2c63da99058 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 6 Sep 2011 15:23:44 +0200 Subject: [PATCH] Added CMake options to disable building of examples and/or tests. --- CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 06acbef0..83eb8bf8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,9 @@ set(GLFW_VERSION_EXTRA "") set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}") set(GLFW_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}") +option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON) +option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON) + include(CheckFunctionExists) include(CheckSymbolExists) @@ -122,8 +125,14 @@ endif(UNIX AND APPLE) # Add subdirectories #-------------------------------------------------------------------- add_subdirectory(src) -add_subdirectory(examples) -add_subdirectory(tests) + +if (GLFW_BUILD_EXAMPLES) + add_subdirectory(examples) +endif(GLFW_BUILD_EXAMPLES) + +if (GLFW_BUILD_TESTS) + add_subdirectory(tests) +endif(GLFW_BUILD_TESTS) #-------------------------------------------------------------------- # Create shared configuration header