# Try to find RapidJSON (header-only). # # This project uses `find_package(RapidJSON)` and expects: # - RapidJSON_FOUND # - RapidJSON_INCLUDE_DIRS # # Homebrew's `rapidjson` formula commonly installs headers to: # /opt/homebrew/include/rapidjson # but does not always ship a `RapidJSONConfig.cmake`, so we provide this # Find-module fallback. find_path(RapidJSON_INCLUDE_DIR NAMES rapidjson/document.h ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(RapidJSON REQUIRED_VARS RapidJSON_INCLUDE_DIR ) if(RapidJSON_FOUND) set(RapidJSON_INCLUDE_DIRS "${RapidJSON_INCLUDE_DIR}") endif() if(RapidJSON_FOUND AND NOT TARGET RapidJSON::RapidJSON) add_library(RapidJSON::RapidJSON INTERFACE IMPORTED) set_target_properties(RapidJSON::RapidJSON PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${RapidJSON_INCLUDE_DIR}" ) endif()