# Smartbotic-MicroBit External Dependencies # Fetch non-apt packages via CMake FetchContent include(FetchContent) # cpp-httplib (HTTP server and client) # Header-only HTTP/HTTPS library FetchContent_Declare( httplib GIT_REPOSITORY https://github.com/yhirose/cpp-httplib.git GIT_TAG v0.18.3 ) # libbcrypt (Password hashing) FetchContent_Declare( libbcrypt GIT_REPOSITORY https://github.com/trusch/libbcrypt.git GIT_TAG master GIT_SHALLOW TRUE ) # nlohmann_json (if not found on system) if(NOT nlohmann_json_FOUND) message(STATUS "Fetching nlohmann_json...") FetchContent_Declare( nlohmann_json GIT_REPOSITORY https://github.com/nlohmann/json.git GIT_TAG v3.11.3 GIT_SHALLOW TRUE OVERRIDE_FIND_PACKAGE ) set(JSON_BuildTests OFF CACHE BOOL "" FORCE) FetchContent_MakeAvailable(nlohmann_json) endif() # Make httplib available (header-only) message(STATUS "Fetching cpp-httplib...") set(HTTPLIB_REQUIRE_OPENSSL ON CACHE BOOL "" FORCE) set(HTTPLIB_USE_OPENSSL_IF_AVAILABLE ON CACHE BOOL "" FORCE) FetchContent_MakeAvailable(httplib) # Make libbcrypt available (manual build due to outdated CMakeLists.txt) message(STATUS "Fetching libbcrypt...") FetchContent_GetProperties(libbcrypt) if(NOT libbcrypt_POPULATED) FetchContent_Populate(libbcrypt) add_library(bcrypt STATIC ${libbcrypt_SOURCE_DIR}/src/bcrypt.c ${libbcrypt_SOURCE_DIR}/src/crypt_blowfish.c ${libbcrypt_SOURCE_DIR}/src/crypt_gensalt.c ${libbcrypt_SOURCE_DIR}/src/wrapper.c ) target_include_directories(bcrypt PUBLIC ${libbcrypt_SOURCE_DIR}/include ${libbcrypt_SOURCE_DIR}/include/bcrypt ) target_compile_options(bcrypt PRIVATE -w) set_target_properties(bcrypt PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) endif()