From 7c573afaca1814ce1c37c00dfcbf107d46d44403 Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Sun, 1 Sep 2024 17:25:02 +0200 Subject: [PATCH] Fixes for MacOS --- CMakeLists.txt | 6 ++++++ README.md | 8 +++++++- pyproject.toml | 4 +--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a2de1a..4b3ce27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,12 @@ if(COFFE_ENABLE_PYTHON) # need to use this annoying hack. Note that this does not guarantee that the # Python executable is the one from the venv, but at least it finds the one # compatible with all of the packages from the venv + if(NOT COFFE_PYTHON_MINOR_VERSION) + execute_process( + COMMAND python -c "import sys;print(sys.version_info.minor)" + OUTPUT_VARIABLE COFFE_PYTHON_MINOR_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + endif() find_package( Python "3.${COFFE_PYTHON_MINOR_VERSION}" EXACT COMPONENTS Interpreter Development.Module diff --git a/README.md b/README.md index 4e6a5a8..52d3607 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ pip install conan Then, generate a profile: ```sh -conan profile detect +conan profile detect --force ``` Finally, install all of the dependencies in the `_build` directory: @@ -134,6 +134,12 @@ If you would additionally like to install all of the various tools for testing, pip install '.[all]' ``` +**NOTE**: if using Conan to install some of the dependencies, you will need to specify the toolchain file using: + +```sh +pip install '.[all]' --config-settings=cmake.define.CMAKE_TOOLCHAIN_FILE="_build/conan_toolchain.cmake" +``` + ## Documentation The documentation for the latest version is available [here](https://jcgoran.github.io/coffe/). diff --git a/pyproject.toml b/pyproject.toml index a36ff06..af5e5fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -100,11 +100,9 @@ verbose = true version = ">=3.15.0" [tool.scikit-build.cmake.define] -# on MacOS, this probably doesn't work; -# to make a wheel, just use `cibuildwheel --platform macos` COFFE_ENABLE_CLASS = "ON" COFFE_ENABLE_PYTHON = "ON" COFFE_ENABLE_MATHOPTS = "ON" -COFFE_ENABLE_CUBA="ON" +COFFE_ENABLE_CUBA = "ON" [tool.setuptools_scm]