Browse Source

Add an cmake option to exclude tests.

Feng Xiao 10 years ago
parent
commit
34448fca45
1 changed files with 4 additions and 2 deletions
  1. 4 2
      cmake/CMakeLists.txt

+ 4 - 2
cmake/CMakeLists.txt

@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8)
 
 project(protobuf C CXX)
 
+option(BUILD_TESTING "Build tests" ON)
 option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
 if (MSVC)
   option(ZLIB "Build with zlib support" OFF)
@@ -66,5 +67,6 @@ endif (MSVC)
 include(libprotobuf-lite.cmake)
 include(libprotobuf.cmake)
 include(libprotoc.cmake)
-include(protoc.cmake)
-include(tests.cmake)
+if (BUILD_TESTING)
+  include(protoc.cmake)
+endif (BUILD_TESTING)