File tree 3 files changed +6
-21
lines changed
3 files changed +6
-21
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,8 @@ option(USE_BUNDLED_CPPHTTPLIB "Enable building of the bundled cpp-httplib" ${USE
21
21
if (CPPHTTPLIB_INCLUDE)
22
22
# we already have cpp-httplib
23
23
elseif (NOT USE_BUNDLED_CPPHTTPLIB)
24
- find_path (CPPHTTPLIB_INCLUDE NAMES httplib.h)
25
-
26
- if (CPPHTTPLIB_INCLUDE)
27
- message (STATUS "Found cpp-httplib: include: ${CPPHTTPLIB_INCLUDE} " )
28
- else ()
29
- message (FATAL_ERROR "Couldn't find system cpp-httplib" )
30
- endif ()
24
+ find_package (httplib CONFIG REQUIRED)
25
+ get_target_property (CPPHTTPLIB_INCLUDE httplib::httplib INTERFACE_INCLUDE_DIRECTORIES )
31
26
else ()
32
27
set (CPPHTTPLIB_SRC "${PROJECT_BINARY_DIR} /cpp-httplib-prefix/src/cpp-httplib" )
33
28
set (CPPHTTPLIB_INCLUDE "${CPPHTTPLIB_SRC} " )
Original file line number Diff line number Diff line change @@ -21,13 +21,8 @@ option(USE_BUNDLED_CXXOPTS "Enable building of the bundled cxxopts" ${USE_BUNDLE
21
21
if (CXXOPTS_INCLUDE_DIR)
22
22
# we already have cxxopts
23
23
elseif (NOT USE_BUNDLED_CXXOPTS)
24
- find_path (CXXOPTS_INCLUDE_DIR NAMES cxxopts.hpp)
25
-
26
- if (CXXOPTS_INCLUDE_DIR)
27
- message (STATUS "Found cxxopts: include: ${CXXOPTS_INCLUDE_DIR} " )
28
- else ()
29
- message (FATAL_ERROR "Couldn't find system cxxopts" )
30
- endif ()
24
+ find_package (cxxopts CONFIG REQUIRED)
25
+ get_target_property (CXXOPTS_INCLUDE_DIR cxxopts::cxxopts INTERFACE_INCLUDE_DIRECTORIES )
31
26
else ()
32
27
set (CXXOPTS_SRC "${PROJECT_BINARY_DIR} /cxxopts-prefix/src/cxxopts/" )
33
28
set (CXXOPTS_INCLUDE_DIR "${CXXOPTS_SRC} /include" )
Original file line number Diff line number Diff line change @@ -21,13 +21,8 @@ option(USE_BUNDLED_NLOHMANN_JSON "Enable building of the bundled nlohmann-json"
21
21
if (nlohmann_json_INCLUDE_DIRS)
22
22
# we already have nlohmnann-json
23
23
elseif (NOT USE_BUNDLED_NLOHMANN_JSON)
24
- find_path (nlohmann_json_INCLUDE_DIRS NAMES nlohmann)
25
-
26
- if (nlohmann_json_INCLUDE_DIRS)
27
- message (STATUS "Found nlohmann-json: include: ${nlohmann_json_INCLUDE_DIRS} " )
28
- else ()
29
- message (FATAL_ERROR "Couldn't find system nlohmann-json" )
30
- endif ()
24
+ find_package (nlohmann_json CONFIG REQUIRED)
25
+ get_target_property (nlohmann_json_INCLUDE_DIRS nlohmann_json::nlohmann_json INTERFACE_INCLUDE_DIRECTORIES )
31
26
else ()
32
27
set (nlohmann_json_INCLUDE_DIRS "${PROJECT_BINARY_DIR} /njson-prefix/include" )
33
28
You can’t perform that action at this time.
0 commit comments