diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2017-09-22 11:38:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-22 11:38:19 -0700 |
commit | c20440222afe368b2ddb1f842d469fdbe10f5389 (patch) | |
tree | 89847c5f4ad640bacec5995b42a411ece4d4cc0c /cmake/protobuf-module.cmake.in | |
parent | c627530946e5d8783c1d9c2bbeb1704e4e868963 (diff) | |
parent | 9829b8f5115137936a2d2e7ed324954d32a5c127 (diff) | |
download | protobuf-c20440222afe368b2ddb1f842d469fdbe10f5389.tar.gz protobuf-c20440222afe368b2ddb1f842d469fdbe10f5389.tar.bz2 protobuf-c20440222afe368b2ddb1f842d469fdbe10f5389.zip |
Merge pull request #3675 from hesmar/hesmar/cmakeAddDllExport
protobuf_generate: add EXPORT_MACRO option
Diffstat (limited to 'cmake/protobuf-module.cmake.in')
-rw-r--r-- | cmake/protobuf-module.cmake.in | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cmake/protobuf-module.cmake.in b/cmake/protobuf-module.cmake.in index 8e4920aa..2e7c021c 100644 --- a/cmake/protobuf-module.cmake.in +++ b/cmake/protobuf-module.cmake.in @@ -2,7 +2,10 @@ # Functions function(PROTOBUF_GENERATE_CPP SRCS HDRS) - if(NOT ARGN) + cmake_parse_arguments(protobuf_generate_cpp "" "EXPORT_MACRO" "" ${ARGN}) + + set(_proto_files "${protobuf_generate_cpp_UNPARSED_ARGUMENTS}") + if(NOT _proto_files) message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files") return() endif() @@ -16,7 +19,7 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS) endif() set(_outvar) - protobuf_generate(${append_arg} LANGUAGE cpp OUT_VAR _outvar ${_import_arg} PROTOS ${ARGN}) + protobuf_generate(${append_arg} LANGUAGE cpp EXPORT_MACRO ${protobuf_generate_cpp_EXPORT_MACRO} OUT_VAR _outvar ${_import_arg} PROTOS ${_proto_files}) set(${SRCS}) set(${HDRS}) |