diff options
author | Feng Xiao <xiaofeng@google.com> | 2016-06-07 10:14:20 -0700 |
---|---|---|
committer | Feng Xiao <xiaofeng@google.com> | 2016-06-07 10:14:20 -0700 |
commit | dfe0c9ad3836dc3756a908fa0e4aee1c2b3f2ce1 (patch) | |
tree | 7e5c78c392443c383f3f73b1e290f03cadbf44c7 /cmake/CMakeLists.txt | |
parent | ed1d560023c5e355b06a896700730725ce7623b8 (diff) | |
parent | 23fef56e6d1541344401191bffa3f5218278f2e3 (diff) | |
download | protobuf-dfe0c9ad3836dc3756a908fa0e4aee1c2b3f2ce1.tar.gz protobuf-dfe0c9ad3836dc3756a908fa0e4aee1c2b3f2ce1.tar.bz2 protobuf-dfe0c9ad3836dc3756a908fa0e4aee1c2b3f2ce1.zip |
Merge pull request #1643 from yeswalrus/cmake-examples
Build examples in CMake
Diffstat (limited to 'cmake/CMakeLists.txt')
-rw-r--r-- | cmake/CMakeLists.txt | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index ac5fe956..5004270f 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1,15 +1,19 @@ # Minimum CMake required cmake_minimum_required(VERSION 2.8.12) -# Project -project(protobuf C CXX) +if(protobuf_VERBOSE) + message(STATUS "Protocol Buffers Configuring...") +endif() # CMake policies cmake_policy(SET CMP0022 NEW) +# Project +project(protobuf C CXX) + # Options -option(protobuf_VERBOSE "Enable for verbose output" OFF) option(protobuf_BUILD_TESTS "Build tests" ON) +option(protobuf_BUILD_EXAMPLES "Build examples" OFF) if (BUILD_SHARED_LIBS) set(protobuf_BUILD_SHARED_LIBS_DEFAULT ON) else (BUILD_SHARED_LIBS) @@ -25,6 +29,9 @@ endif (MSVC) option(protobuf_WITH_ZLIB "Build with zlib support" ${protobuf_WITH_ZLIB_DEFAULT}) set(protobuf_DEBUG_POSTFIX "d" CACHE STRING "Default debug postfix") +mark_as_advanced(protobuf_DEBUG_POSTFIX) +# User options +include(protobuf-options.cmake) # Path to main configure script set(protobuf_CONFIGURE_SCRIPT "../configure.ac") @@ -151,3 +158,11 @@ if (protobuf_BUILD_TESTS) endif (protobuf_BUILD_TESTS) include(install.cmake) + +if (protobuf_BUILD_EXAMPLES) + include(examples.cmake) +endif (protobuf_BUILD_EXAMPLES) + +if(protobuf_VERBOSE) + message(STATUS "Protocol Buffers Configuring done") +endif() |