File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,22 @@ if (NOT BUILD_OPTION_DOC_ONLY)
4242 if (DEFINED ENV{LIBRDKAFKA_INCLUDE_DIR})
4343 set (LIBRDKAFKA_INCLUDE_DIR $ENV{LIBRDKAFKA_INCLUDE_DIR} )
4444 else ()
45- set (LIBRDKAFKA_INCLUDE_DIR /usr/local/include )
45+ find_file (LIBRDKAFKA_HEADER
46+ NAMES rdkafka.h
47+ HINTS /usr/include /librdkafka /usr/local/include /librdkafka /opt/homebrew/include /librdkafka)
48+
49+ cmake_path(GET LIBRDKAFKA_HEADER PARENT_PATH LIBRDKAFKA_INCLUDE_DIR)
50+ cmake_path(GET LIBRDKAFKA_INCLUDE_DIR PARENT_PATH LIBRDKAFKA_INCLUDE_DIR)
4651 endif ()
52+
4753 if (DEFINED ENV{LIBRDKAFKA_LIBRARY_DIR})
4854 set (LIBRDKAFKA_LIBRARY_DIR $ENV{LIBRDKAFKA_LIBRARY_DIR} )
4955 else ()
50- set (LIBRDKAFKA_LIBRARY_DIR /usr/local/lib)
56+ find_library (LIBRDKAFKA_LIB
57+ NAMES rdkafka
58+ HINTS /usr/lib /usr/local/lib /opt/homebrew/lib)
59+
60+ cmake_path(GET LIBRDKAFKA_LIB PARENT_PATH LIBRDKAFKA_LIBRARY_DIR)
5161 endif ()
5262
5363 if (EXISTS "${LIBRDKAFKA_INCLUDE_DIR} /librdkafka/rdkafka.h" )
Original file line number Diff line number Diff line change @@ -6,7 +6,12 @@ project("kafka-unit-test")
66if (DEFINED ENV{RAPIDJSON_INCLUDE_DIRS})
77 set (RAPIDJSON_INCLUDE_DIRS $ENV{RAPIDJSON_INCLUDE_DIRS} )
88else ()
9- set (RAPIDJSON_INCLUDE_DIRS /usr/include )
9+ find_file (RAPIDJSON_HEADER
10+ NAMES rapidjson.h
11+ HINTS /usr/include /rapidjson /usr/local/include /rapidjson /opt/homebrew/include /rapidjson)
12+
13+ cmake_path(GET RAPIDJSON_HEADER PARENT_PATH RAPIDJSON_INCLUDE_DIRS)
14+ cmake_path(GET RAPIDJSON_INCLUDE_DIRS PARENT_PATH RAPIDJSON_INCLUDE_DIRS)
1015endif ()
1116
1217if (EXISTS "${RAPIDJSON_INCLUDE_DIRS} /rapidjson/rapidjson.h" )
You can’t perform that action at this time.
0 commit comments