Skip to content

Commit 1ff785e

Browse files
committed
cmake: bump deps
cmake: move re2 since it is a deps of protobuf
1 parent f4687dd commit 1ff785e

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

CMakeLists.txt

Lines changed: 9 additions & 4 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}")
@@ -101,6 +101,9 @@ endif()
101101
message(STATUS "Build googletest: ${BUILD_googletest}")
102102
message(STATUS "Build benchmark: ${BUILD_benchmark}")
103103

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

@@ -113,7 +116,9 @@ include(check_deps)
113116

114117
include(cpp)
115118

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

cmake/check_deps.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ endif()
5252

5353
# CXX Test
5454
if(BUILD_TESTING)
55+
if(NOT TARGET GTest::gtest)
56+
message(FATAL_ERROR "Target GTest::gtest not available.")
57+
endif()
5558
if(NOT TARGET GTest::gtest_main)
5659
message(FATAL_ERROR "Target GTest::gtest_main not available.")
5760
endif()

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}

cmake/dependencies/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ if(BUILD_googletest)
121121
"${CMAKE_CURRENT_LIST_DIR}/../../patches/googletest-v1.17.0.patch"
122122
)
123123
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
124-
set(INSTALL_GTEST OFF)
125124
set(GTEST_HAS_ABSL ON)
125+
set(INSTALL_GTEST OFF)
126126
FetchContent_MakeAvailable(googletest)
127127
list(POP_BACK CMAKE_MESSAGE_INDENT)
128128
message(CHECK_PASS "fetched")

0 commit comments

Comments
 (0)