File tree 3 files changed +23
-18
lines changed
3 files changed +23
-18
lines changed Original file line number Diff line number Diff line change @@ -85,20 +85,18 @@ message(STATUS "Build abseil-cpp: ${BUILD_absl}")
85
85
option (BUILD_Protobuf "Build the Protobuf dependency Library" ON )
86
86
message (STATUS "Build protobuf: ${BUILD_Protobuf} " )
87
87
88
- if (BUILD_TESTING)
89
- option (BUILD_re2 "Build the re2 dependency Library" ON )
90
- message (STATUS "Build re2: ${BUILD_re2} " )
88
+ option (BUILD_re2 "Build the re2 dependency Library" ON )
89
+ message (STATUS "Build re2: ${BUILD_re2} " )
91
90
91
+ if (BUILD_TESTING)
92
92
option (BUILD_googletest "Build googletest" ON )
93
- message (STATUS "Build googletest: ${BUILD_googletest} " )
94
-
95
93
option (BUILD_benchmark "Build benchmark" ON )
96
- message (STATUS "Build benchmark: ${BUILD_benchmark} " )
97
94
else ()
98
- set (BUILD_re2 OFF )
99
95
set (BUILD_googletest OFF )
100
96
set (BUILD_benchmark OFF )
101
97
endif ()
98
+ message (STATUS "Build googletest: ${BUILD_googletest} " )
99
+ message (STATUS "Build benchmark: ${BUILD_benchmark} " )
102
100
103
101
# Find system deps
104
102
include (system_deps)
Original file line number Diff line number Diff line change @@ -45,13 +45,16 @@ if(NOT TARGET protobuf::libprotobuf)
45
45
message (FATAL_ERROR "Target protobuf::libprotobuf not available." )
46
46
endif ()
47
47
48
+ if (NOT TARGET re2::re2)
49
+ message (FATAL_ERROR "Target re2::re2 not available." )
50
+ endif ()
51
+
48
52
# CXX Test
49
53
if (BUILD_TESTING)
50
- if (NOT TARGET re2::re2)
51
- message (FATAL_ERROR "Target re2::re2 not available." )
52
- endif ()
53
-
54
54
if (NOT TARGET GTest::gtest_main)
55
55
message (FATAL_ERROR "Target GTest::gtest_main not available." )
56
56
endif ()
57
+ if (NOT TARGET benchmark::benchmark)
58
+ message (FATAL_ERROR "Target benchmark::benchmark not available." )
59
+ endif ()
57
60
endif ()
Original file line number Diff line number Diff line change @@ -9,25 +9,29 @@ find_package(Threads REQUIRED)
9
9
set (CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE )
10
10
11
11
# libprotobuf force us to depends on ZLIB::ZLIB target
12
- if (NOT BUILD_ZLIB)
12
+ if (NOT BUILD_ZLIB AND NOT TARGET ZLIB::ZLIB )
13
13
find_package (ZLIB REQUIRED)
14
14
endif ()
15
15
16
- if (NOT BUILD_absl)
16
+ if (NOT BUILD_absl AND NOT TARGET absl::base )
17
17
find_package (absl REQUIRED)
18
18
endif ()
19
19
20
- if (NOT BUILD_Protobuf)
20
+ if (NOT BUILD_Protobuf AND NOT TARGET protobuf::libprotobuf )
21
21
find_package (Protobuf REQUIRED)
22
22
endif ()
23
23
24
+ if (NOT BUILD_re2 AND NOT TARGET re2::re2)
25
+ find_package (re2 REQUIRED)
26
+ endif ()
27
+
24
28
# CXX Test
25
29
if (BUILD_TESTING)
26
- if (NOT BUILD_re2 )
27
- find_package (re2 REQUIRED)
30
+ if (NOT BUILD_googletest AND NOT TARGET GTest::gtest_main )
31
+ find_package (GTest REQUIRED)
28
32
endif ()
29
33
30
- if (NOT BUILD_googletest )
31
- find_package (GTest REQUIRED)
34
+ if (NOT BUILD_benchmark AND NOT TARGET benchmark::benchmark )
35
+ find_package (benchmark REQUIRED)
32
36
endif ()
33
37
endif ()
You can’t perform that action at this time.
0 commit comments