diff options
author | Konstantin Podsvirov <konstantin@podsvirov.pro> | 2016-06-01 17:00:08 +0300 |
---|---|---|
committer | Konstantin Podsvirov <konstantin@podsvirov.pro> | 2016-06-04 00:10:07 +0300 |
commit | 71556295ffe315be34ce70e1a6821860fb088f07 (patch) | |
tree | 2429940c0d78972693670df9aea755cf23ec9d59 /cmake/CMakeLists.txt | |
parent | 20b532544fde1dff34429b52db95c3a96409b73c (diff) | |
download | protobuf-71556295ffe315be34ce70e1a6821860fb088f07.tar.gz protobuf-71556295ffe315be34ce70e1a6821860fb088f07.tar.bz2 protobuf-71556295ffe315be34ce70e1a6821860fb088f07.zip |
CMake project updates
A series of improvements:
- Improved Protobuf module compatibility (disabled by default);
- Hide advanced settings;
- Added build tree configuration;
- Added build of examples.
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..5e818e09 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("${CMAKE_CURRENT_LIST_DIR}/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() |