Skip to content

Commit 31404ed

Browse files
committed
cmake: move re2 since it is a deps of protobuf
1 parent 6eb30d3 commit 31404ed

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ option(BUILD_ZLIB "Build the ZLIB dependency Library" ON)
8383
message(STATUS "Build ZLIB: ${BUILD_ZLIB}")
8484

8585
option(BUILD_absl "Build the abseil-cpp dependency Library" ON)
86-
message(STATUS "Build abseil-cpp: ${BUILD_absl}")
86+
message(STATUS "Build absl: ${BUILD_absl}")
8787

8888
option(BUILD_re2 "Build the RE2 dependency Library" ON)
8989
message(STATUS "Build re2: ${BUILD_re2}")
@@ -92,18 +92,18 @@ option(BUILD_Protobuf "Build the Protobuf dependency Library" ON)
9292
message(STATUS "Build protobuf: ${BUILD_Protobuf}")
9393

9494
if(BUILD_TESTING)
95-
option(BUILD_re2 "Build the RE2 dependency Library" ON)
9695
option(BUILD_googletest "Build googletest" ON)
9796
option(BUILD_benchmark "Build benchmark" ON)
9897
else()
99-
set(BUILD_re2 OFF)
10098
set(BUILD_googletest OFF)
10199
set(BUILD_benchmark OFF)
102100
endif()
103-
message(STATUS "Build re2: ${BUILD_re2}")
104101
message(STATUS "Build googletest: ${BUILD_googletest}")
105102
message(STATUS "Build benchmark: ${BUILD_benchmark}")
106103

104+
option(BUILD_EXAMPLES "Build examples" ON)
105+
message(STATUS "Build examples: ${BUILD_EXAMPLES}")
106+
107107
# Find system deps
108108
include(system_deps)
109109

@@ -116,7 +116,9 @@ include(check_deps)
116116

117117
include(cpp)
118118

119-
## Examples
120-
option(BUILD_EXAMPLES "Build examples" ON)
121-
message(STATUS "Build examples: ${BUILD_EXAMPLES}")
119+
add_subdirectory(Foo)
120+
add_subdirectory(Bar)
121+
add_subdirectory(FooBar)
122+
add_subdirectory(FooBarApp)
123+
122124
add_subdirectory(examples)

cmake/cpp.cmake

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ macro(get_cpp_proto PROTO_HDRS PROTO_SRCS)
6161
COMMAND ${PROTOC_PRG}
6262
"--proto_path=${PROJECT_SOURCE_DIR}"
6363
${PROTO_DIRS}
64-
"--cpp_out=${PROJECT_BINARY_DIR}"
64+
"--cpp_out=dllexport_decl=PROTO_DLL:${PROJECT_BINARY_DIR}"
6565
${PROTO_FILE}
6666
DEPENDS ${PROTO_NAME}.proto ${PROTOC_PRG}
6767
COMMENT "Generate C++ protocol buffer for ${PROTO_FILE}"
@@ -72,14 +72,9 @@ macro(get_cpp_proto PROTO_HDRS PROTO_SRCS)
7272
endforeach()
7373
endmacro()
7474

75-
76-
add_subdirectory(Foo)
77-
add_subdirectory(Bar)
78-
add_subdirectory(FooBar)
79-
80-
add_subdirectory(FooBarApp)
81-
82-
# Install
75+
###################
76+
## CMake Install ##
77+
###################
8378
install(EXPORT ${PROJECT_NAME}Targets
8479
NAMESPACE ${PROJECT_NAMESPACE}::
8580
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}

0 commit comments

Comments
 (0)