THRIFT-3245 Tutorials can't be disabled when using CMake
Client: cpp
Patch: Pascal Bach
This closes #551
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63e003e..44f65af 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,7 +73,9 @@
if(BUILD_CPP)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/cpp)
- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tutorial/cpp)
+ if(BUILD_TUTORIALS)
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tutorial/cpp)
+ endif(BUILD_TUTORIALS)
if(BUILD_TESTING)
if(WITH_LIBEVENT AND WITH_ZLIB AND WITH_OPENSSL)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/cpp)
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
index adedcc8..d336c50 100644
--- a/build/cmake/DefineOptions.cmake
+++ b/build/cmake/DefineOptions.cmake
@@ -24,6 +24,7 @@
option(BUILD_COMPILER "Build Thrift compiler" ON)
option(BUILD_TESTING "Build with unit tests" ON)
option(BUILD_EXAMPLES "Build examples" ON)
+option(BUILD_TUTORIALS "Build Thrift tutorials" ON)
option(BUILD_LIBRARIES "Build Thrift libraries" ON)
# Libraries to build