samhatchett /
template-scikit-cmake-swig
template project for swig-generated python wrapper around cmake-built library, using scikit-build
40/100 healthLoading repository data…
conan-io / repository
CMake wrapper for conan C and C++ package manager
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
CMake dependency provider for the Conan C and C++ package manager.
⚠️ Important: Conan 2 is the recommended production version for cmake-conan. |
|---|
The cmake-conan integration in this develop2 branch for Conan 2 using CMake dependency providers, even if not released as 1.0 yet, is more stable, production-ready and recommended than the legacy cmake-conan for Conan 1. Please update to Conan 2 and the new cmake-conan integration in this develop2 branch. |
From the 0.19.0 release, the tagged releases in this repo are Conan 2.X compatible. Feel free to use these releases instead of the develop2 branch for stability, but recall that these versions are not considered stable, and things can break in future releases. |
Prerequisites:
conanfile.txt or conanfile.py to list the required dependencies.First, clone this repository in the develop2 branch.
git clone https://github.com/conan-io/cmake-conan.git -b develop2
This repository contains a CMakeLists.txt with an example project that depends on fmt.
cd cmake-conan/example
mkdir build
cmake -B build -S . -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=../conan_provider.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
Ensure you have placed a conanfile.txt or conanfile.py at the root of your project, listing your requirements. You can see conanfile.txt for an example, or check the Conan documentation for conanfile: .txt docs, .py docs.
When first invoking CMake to configure the project, pass -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=[path-to-cmake-conan]/conan_provider.cmake. This will ensure that conan install is invoked from within CMake. This integration does not require making any changes to your CMakeLists.txt scripts.
cd [your-project]
mkdir build
cmake -B build -S . -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=[path-to-cmake-conan]/conan_provider.cmake -DCMAKE_BUILD_TYPE=Release
CMakeConfigDeps generator is the recommended for cmake-conan. It is designed to solve some previous issues of CMakeDeps.CMakeToolchain (for example, the compiler itself or other global build settings) please invoke Conan separately as per documentation, that is first calling conan install then cmake --presetcmake-conan triggers the conan install at the first find_package() occurence. That means that any other dependencies that have logic outside of find_package, for example, by making direct calls to find_program, find_library, find_path or find_file, these may not work correctly if done after, and they must follow at least one find_package().CMAKE_BUILD_TYPE (can't be left blank). Alternatively, CONAN_INSTALL_BUILD_CONFIGURATIONS can be set to a non-empty list of build types (see next section).conan_provider.cmake only supports the main compilers of the mainstream platforms, that means Windows+MSVC, Linux+gcc, Apple+clang. All other compilers, architecturs and variants will need Conan profile files for specifying the inputs.The CMake-Conan dependency provider will create a Conan profile where the settings (os, arch, compiler, build_type) are retrieved from what CMake has detected for the current build. Conan uses two profiles for dependencies, the host and the build profiles. You can read more about them here. In CMake-Conan, the default behaviour is as follows:
default Conan profile.default Conan profile.Please note that for the above to work, a default profile must already exist. If it doesn't, cmake-conan will invoke Conan's autodetection mechanism which tries to guess the system defaults.
If you need to customize the profile, you can do so by modifying the value of CONAN_HOST_PROFILE and CONAN_BUILD_PROFILE and passing them as CMake cache variables. Some examples:
-DCONAN_HOST_PROFILE="default;auto-cmake": perform autodetection as described above, and fallback to the default profile for anything else (default behaviour).-DCONAN_HOST_PROFILE=clang16: do not perform autodetection, and use the clang16 profile which must exist in the Conan profiles folder (see docs.)-DCONAN_BUILD_PROFILE="/path/to/profile": alternatively, provide a path to a profile file that may be anywhere in the filesystem.-DCONAN_HOST_PROFILE="default;custom": semi-colon separated list of profiles. A compound profile will be used (see docs) - compunded from left to right, where right has the highest priority.Any build_type specified by a host profile is ignored.
The build_type is handled separately, and the default behavior depends on the CMake generator used:
conan install is executed once with build_type set to the CMAKE_BUILD_TYPE. The CMAKE_BUILD_TYPE must not be empty.conan install is executed twice: once with build_type set to Release, and a second time with build_type set to Debug.You can override the default build type(s) by setting the CONAN_INSTALL_BUILD_CONFIGURATIONS CMake variable to a list of build types.
conan install will then be invoked once for each build type.
This can be used with both single- and multi-configuration generators, although currently only one build type can be specified for single-configuration generators.
For example:
-DCONAN_INSTALL_BUILD_CONFIGURATIONS=Release;Debug: execute conan install for both Release and Debug build types with a multi-configuration generator.-DCONAN_INSTALL_BUILD_CONFIGURATIONS=Release: execute conan install once for just the Release build type, applicable for both single- and multi-configuration generators.The CMake-Conan dependency provider will autodetect and pass the profile information as described above. If the conan install command invocation needs to be customized further, the CONAN_INSTALL_ARGS variable can be used.
CONAN_INSTALL_ARGS is initialised to pass --build=missing. If you customize this variable, please be aware that Conan will revert to its default behaviour unless you specify the --build flag.CONAN_INSTALL_ARGS:
conanfile.txt|.py.--format).-s build_type=...).--build=never;--update;--lockfile-out=''There are some tests, you can run in python, with pytest, for example:
$ pytest -rA
Selected from shared topics, language and repository description—not editorial ratings.
samhatchett /
template project for swig-generated python wrapper around cmake-built library, using scikit-build
40/100 healthaquacommander /
⭐This project is an API wrapper around stable model that generates tempo consistent, key and scale consistent music loops from text prompts. It also supports lyrics and vocal generation when available, providing a unified interface for both instrumental and vocal audio creation.⭐
55/100 healthbes-dev /
Template of python wrapper for C++ class using pybind11+CMake
PRITHIVSAKTHIUR /
A C++ project wrapper around a rich Web App for Qwen3.5 and Qwen3-VL models. Powered by pybind11 and an embedded native C++ HTTP server (httplib).
56/100 healthstephenswat /
A wrapper script for rapid CMake development
31/100 healthchrrs /
Automatically generated C++ wrapper for webgpu-native
41/100 health