File tree Expand file tree Collapse file tree 4 files changed +17
-14
lines changed
Expand file tree Collapse file tree 4 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ option(BUILD_ZLIB "Build the ZLIB dependency Library" ON)
8383message (STATUS "Build ZLIB: ${BUILD_ZLIB} " )
8484
8585option (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
8888option (BUILD_re2 "Build the RE2 dependency Library" ON )
8989message (STATUS "Build re2: ${BUILD_re2} " )
@@ -101,6 +101,9 @@ endif()
101101message (STATUS "Build googletest: ${BUILD_googletest} " )
102102message (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
105108include (system_deps)
106109
@@ -113,7 +116,9 @@ include(check_deps)
113116
114117include (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+
119124add_subdirectory (examples)
Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ endif()
5252
5353# CXX Test
5454if (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 ()
Original file line number Diff line number Diff 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 ()
7373endmacro ()
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+ ###################
8378install (EXPORT ${PROJECT_NAME} Targets
8479 NAMESPACE ${PROJECT_NAMESPACE} ::
8580 DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/${PROJECT_NAME}
Original file line number Diff line number Diff 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" )
You can’t perform that action at this time.
0 commit comments