diff --git a/CMakeUserPresets.macos.sample.json b/CMakeUserPresets.macos.sample.json new file mode 100644 index 0000000000..e44c2fb631 --- /dev/null +++ b/CMakeUserPresets.macos.sample.json @@ -0,0 +1,66 @@ +{ + "version": 6, + "configurePresets": [ + { + "name": "kichad-macos", + "displayName": "KiChad macOS development build", + "description": "RelWithDebInfo build with QA tests, Homebrew deps, isolated kichad settings", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/release-macos", + "installDir": "${sourceDir}/build/install-macos", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install-macos", + "CMAKE_PREFIX_PATH": "/opt/homebrew/opt/boost@1.85;/opt/homebrew;/opt/homebrew/opt/protobuf@33", + "Boost_ROOT": "/opt/homebrew/opt/boost@1.85", + "CMAKE_CXX_FLAGS": "-isystem /opt/homebrew/opt/boost@1.85/include", + "CMAKE_C_COMPILER_LAUNCHER": "ccache", + "CMAKE_CXX_COMPILER_LAUNCHER": "ccache", + "PYTHON_FRAMEWORK": "/opt/homebrew/opt/python@3.13/Frameworks/Python.framework", + "PYTHON_EXECUTABLE": "/opt/homebrew/opt/python@3.13/bin/python3.13", + "PYTHON_LIBRARY": "/opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/lib/libpython3.13.dylib", + "PYTHON_INCLUDE_DIR": "/opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13", + "OCC_INCLUDE_DIR": "/opt/homebrew/opt/opencascade/include/opencascade", + "OCC_LIBRARY_DIR": "/opt/homebrew/opt/opencascade/lib", + "NGSPICE_LIB_NAME": "ngspice", + "NGSPICE_ROOT_DIR": "/opt/homebrew/opt/libngspice", + "KICAD_BUILD_I18N": "OFF", + "KICAD_BUILD_QA_TESTS": "ON", + "KICAD_CONFIG_DIR": "kichad", + "KICAD_IPC_API": "ON", + "KICAD_VERSION_EXTRA": "KiChad", + "KICAD_SCRIPTING_WXPYTHON": "OFF", + "KICAD_UPDATE_CHECK": "OFF" + } + } + ], + "buildPresets": [ + { + "name": "kichad-macos", + "displayName": "Build KiChad (macOS)", + "configurePreset": "kichad-macos" + } + ], + "testPresets": [ + { + "name": "kichad-macos", + "displayName": "Test KiChad (macOS)", + "configurePreset": "kichad-macos", + "environment": { + "KICAD_RUN_FROM_BUILD_DIR": "1" + }, + "output": { + "outputOnFailure": true + }, + "execution": { + "noTestsAction": "error", + "stopOnFailure": true + } + } + ] +} diff --git a/KICHAD.md b/KICHAD.md index 8ef411f67f..9ca853f9d6 100644 --- a/KICHAD.md +++ b/KICHAD.md @@ -50,6 +50,33 @@ version and makes the installed launchers self-contained. `./tools/fetch-kicad-l `./tools/install-kichad-libraries.sh` remain available when only the library runtime needs to be refreshed. Neither command tracks the libraries' moving development branch. +## macOS development build (experimental) + +The qualified platform remains Ubuntu 24.04; macOS is a development convenience only. The tracked +`CMakePresets.json` stays Linux-only by policy, so the macOS configuration ships as a sample user +preset: + +```sh +cp CMakeUserPresets.macos.sample.json CMakeUserPresets.json +cmake --preset kichad-macos +cmake --build --preset kichad-macos +``` + +Notes on the sample: + +- Paths assume arm64 Homebrew under `/opt/homebrew`; on Intel Macs substitute `/usr/local`. +- Boost is pinned to the `boost@1.85` keg: Boost 1.90 removed the Boost.Process v1 API used by + `kicad/codex`. If the plain `boost` formula (1.90+) is installed, `brew unlink boost` so its + headers do not shadow 1.85. +- The preset pins the `python@3.13` framework, `protobuf@33`, `opencascade`, and `libngspice` + kegs; install those plus KiCad's usual build dependencies (wxWidgets, ninja, ccache, glew, glm, + cairo, …) from Homebrew. +- Building this source line on macOS requires the toolchain compatibility shims from the + `feature/macos-build-compat` branch until they are merged. +- Developer builds expect a `codex` executable on `PATH` (distribution packaging is not covered + here). Running the GUI and the QA suite from the build tree additionally needs bundle + scaffolding (SharedSupport data, a `Python.framework` link) that no script creates yet. + ## Useful checks ```sh