From 71556295ffe315be34ce70e1a6821860fb088f07 Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Wed, 1 Jun 2016 17:00:08 +0300 Subject: 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. --- cmake/CMakeLists.txt | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'cmake/CMakeLists.txt') 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() -- cgit v1.2.3