forked from conan-io/conan-center-index
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Uilian Ries <uilianries@gmail.com>
- Loading branch information
1 parent
209da0b
commit d9dc437
Showing
3 changed files
with
24 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
cmake_minimum_required(VERSION 2.8.12) | ||
project(test_package CXX) | ||
|
||
set(CMAKE_VERBOSE_MAKEFILE ON) | ||
|
||
# Findprotoc.cmake generated by Conan does not give a hint where protoc is installed. | ||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
set(CMAKE_VERBOSE_MAKEFILE ON) | ||
find_package(protoc) | ||
|
||
find_package(protoc CONFIG REQUIRED) | ||
if (NOT protobuf_MODULE_COMPATIBLE) | ||
message(FATAL_ERROR "protobuf_MODULE_COMPATIBLE is mandatory") | ||
endif() | ||
|
||
message(STATUS "Using Protocol Buffers ${protobuf_VERSION}") | ||
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS addressbook.proto) | ||
message(STATUS "PROTO_SRCS: ${PROTO_SRCS}") | ||
message(STATUS "PROTO_HDRS: ${PROTO_HDRS}") | ||
|
||
if(protobuf_MODULE_COMPATIBLE) | ||
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS addressbook.proto) | ||
message(STATUS "PROTO_SRCS: ${PROTO_SRCS}") | ||
message(STATUS "PROTO_HDRS: ${PROTO_HDRS}") | ||
endif(protobuf_MODULE_COMPATIBLE) | ||
# Without a target, Protobuf will not generate sources and headers | ||
add_executable(${CMAKE_PROJECT_NAME} "${PROTO_HDRS}" example.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters