pcbjam/cmake/FindCURL.cmake
Viktor Vaczi f1526d8c24 Complete Phase 1: Build KiCad with optional dependencies disabled
Add CMake override modules, stub implementations, and patches to build
KiCad without CURL, libgit2, OpenCASCADE, and ngspice dependencies.

- cmake/: Find modules that provide stub targets when deps disabled
- stubs/include/: Header stubs for curl, git2, ngspice, OCC
- stubs/src/: Implementation stubs for disabled features
- patches/: Consolidated patch for KiCad source modifications
- scripts/: Build helper scripts

Verified full native build on macOS with all optional deps disabled.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 16:33:48 +01:00

34 lines
919 B
CMake

#
# KiCad Wasm Port - CURL Find Module Override
#
# When KICAD_USE_CURL=OFF, this module provides stub values
# so the build can proceed without libcurl.
#
# Check if curl is disabled
if(DEFINED KICAD_USE_CURL AND NOT KICAD_USE_CURL)
message(STATUS "CURL: DISABLED (KICAD_USE_CURL=OFF)")
# Set variables that KiCad expects
set(CURL_FOUND TRUE)
set(CURL_INCLUDE_DIRS "")
set(CURL_LIBRARIES "")
set(CURL_VERSION_STRING "stub")
# Create an imported target that does nothing
if(NOT TARGET CURL::libcurl)
add_library(CURL::libcurl INTERFACE IMPORTED)
endif()
return()
endif()
# Otherwise, use CMake's built-in FindCURL
# Remove our path to avoid recursion
list(REMOVE_ITEM CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
# Use built-in module
include(${CMAKE_ROOT}/Modules/FindCURL.cmake)
# Restore module path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")