From a61dbbdb02d1e50fb49147cc689f11dce2e62534 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 5 Mar 2026 16:51:37 +0100 Subject: [FEAT] Add Conan support. Signed-off-by: Amlal El Mahrouss --- .gitignore | 1 + CMakeLists.txt | 5 +---- conanfile.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 conanfile.py diff --git a/.gitignore b/.gitignore index 2364b33..b7bef96 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ __pycache__/ +CMakeUserPresets.json build/ doc/html/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 00a1592..58414bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,4 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) - -if (INSTALL_OCL) - include(install_ocl.cmake) -endif() +include(install_ocl.cmake) diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 0000000..5b9cd89 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,48 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps + +class oclRecipe(ConanFile): + name = "Open C++ Libraries." + version = "1.62.0" + + # Optional metadata + license = "BSL-1.0" + author = "Amlal El Mahrouss amlal@nekernel.org" + url = "https://git.ocl.nekernel.org/src" + description = "The Open C++ Libraries super-project." + topics = ("c++17", "libraries", "cpp") + + # Binary configuration + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + exports_sources = "CMakeLists.txt", "libs/*", "include/*" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self) + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["ocl"] + + + -- cgit v1.2.3