mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-08 10:09:40 +00:00
refactor(build): use find_package when possible
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
This commit is contained in:
committed by
poiana
parent
97806a98fb
commit
1705fc2281
@@ -21,13 +21,8 @@ option(USE_BUNDLED_NLOHMANN_JSON "Enable building of the bundled nlohmann-json"
|
||||
if(nlohmann_json_INCLUDE_DIRS)
|
||||
# we already have nlohmnann-json
|
||||
elseif(NOT USE_BUNDLED_NLOHMANN_JSON)
|
||||
find_path(nlohmann_json_INCLUDE_DIRS NAMES nlohmann)
|
||||
|
||||
if(nlohmann_json_INCLUDE_DIRS)
|
||||
message(STATUS "Found nlohmann-json: include: ${nlohmann_json_INCLUDE_DIRS}")
|
||||
else()
|
||||
message(FATAL_ERROR "Couldn't find system nlohmann-json")
|
||||
endif()
|
||||
find_package(nlohmann_json CONFIG REQUIRED)
|
||||
get_target_property(nlohmann_json_INCLUDE_DIRS nlohmann_json::nlohmann_json INTERFACE_INCLUDE_DIRECTORIES)
|
||||
else()
|
||||
set(nlohmann_json_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/njson-prefix/include")
|
||||
|
||||
|
Reference in New Issue
Block a user