{"id":23486,"library":"cython-cmake","title":"cython-cmake","description":"CMake helpers for building Cython modules. Version 0.2.2, with monthly releases. Provides CMake modules to find Cython and compile Cython-generated C/C++ code into Python extension modules.","status":"active","version":"0.2.2","language":"python","source_language":"en","source_url":"https://github.com/scikit-build/cython-cmake","tags":["CMake","Cython","build-tools","extension-modules"],"install":[{"cmd":"pip install cython-cmake","lang":"bash","label":"pip"},{"cmd":"conda install conda-forge::cython-cmake","lang":"bash","label":"conda"}],"dependencies":[{"reason":"Runtime dependency for Cython compilation","package":"Cython","optional":false},{"reason":"Build tool required to run CMake","package":"cmake","optional":true}],"imports":[{"note":"Since v0.2.0, CMake modules are vendored and paths changed. Use FetchContent to download and include.","wrong":"Old path cython-cmake/cmake/FindCython.cmake","symbol":"FindCython.cmake","correct":"include(FetchContent) then include(${CMAKE_BINARY_DIR}/_deps/cython-cmake-src/cmake/FindCython.cmake)"}],"quickstart":{"code":"cmake_minimum_required(VERSION 3.14)\nproject(MyProject)\ninclude(FetchContent)\nFetchContent_Declare(\n  cython-cmake\n  GIT_REPOSITORY https://github.com/scikit-build/cython-cmake.git\n  GIT_TAG v0.2.2\n)\nFetchContent_MakeAvailable(cython-cmake)\nlist(APPEND CMAKE_MODULE_PATH ${cython-cmake_SOURCE_DIR}/cmake)\nfind_package(Cython REQUIRED)\n# Now use add_cython_target() etc.","lang":"cmake","description":"Create a CMakeLists.txt with FetchContent to download cython-cmake and use its CMake modules."},"warnings":[{"fix":"Update CMake code to reference Cython::Cython and Cython::Cythonize instead of old names.","message":"v0.2.0 renamed CMake targets and variables. Old FindCython.cmake targets (Cython::cython, Cython::cythonize) changed to Cython::Cython and Cython::Cythonize.","severity":"breaking","affected_versions":"<0.2.0"},{"fix":"Use FetchContent to download cython-cmake and append its cmake directory to CMAKE_MODULE_PATH.","message":"v0.2.0 changed how to include CMake modules. Previously modules were installed site-wide; now they must be fetched via FetchContent or vendored.","severity":"breaking","affected_versions":"<0.2.0"},{"fix":"pip install cython or conda install cython before running cmake.","message":"Requires Cython to be installed. If Cython is not present, find_package(Cython) will fail. Install Cython via pip or conda.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to cython-cmake>=0.2.2.","message":"VERSION_VAR in FindCython.cmake was broken in v0.2.1 and fixed in v0.2.2. If you specify a version, upgrade to v0.2.2.","severity":"gotcha","affected_versions":"0.2.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure Cython is installed (pip install cython) and that find_package can find it. Set Cython_DIR if necessary.","cause":"Cython is not installed or not found by CMake.","error":"CMake Error at FindCython.cmake:xxx (find_package): Could not find a package configuration file provided by \"Cython\""},{"fix":"pip install cython or conda install cython.","cause":"Cython Python package is not installed.","error":"ModuleNotFoundError: No module named 'Cython'"},{"fix":"Set Cython_EXECUTABLE to the path of the cython command, or rebuild with a complete Cython installation.","cause":"CMake found Cython Python package but cannot locate the cython executable.","error":"CMake Error at FindCython.cmake:xxx (find_package): Could not find Cython (missing: Cython_EXECUTABLE)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}