From 375aca0b7391363e62f142c592f3f79d1f51b632 Mon Sep 17 00:00:00 2001 From: chausner Date: Fri, 22 Oct 2021 20:34:15 +0200 Subject: [PATCH] Use CMake conan helper wrapper --- recipes/soxr/all/CMakeLists.txt | 7 +++++++ recipes/soxr/all/conandata.yml | 2 ++ recipes/soxr/all/conanfile.py | 4 ++-- recipes/soxr/all/patches/cmake-source-dir.patch | 12 ++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 recipes/soxr/all/CMakeLists.txt create mode 100644 recipes/soxr/all/patches/cmake-source-dir.patch diff --git a/recipes/soxr/all/CMakeLists.txt b/recipes/soxr/all/CMakeLists.txt new file mode 100644 index 0000000000000..6d3414de0c415 --- /dev/null +++ b/recipes/soxr/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") \ No newline at end of file diff --git a/recipes/soxr/all/conandata.yml b/recipes/soxr/all/conandata.yml index 98222da3389fa..adadd20f78613 100644 --- a/recipes/soxr/all/conandata.yml +++ b/recipes/soxr/all/conandata.yml @@ -6,3 +6,5 @@ patches: "0.1.3": - base_path: source_subfolder patch_file: "patches/findpackage-openmp.patch" + - base_path: source_subfolder + patch_file: "patches/cmake-source-dir.patch" diff --git a/recipes/soxr/all/conanfile.py b/recipes/soxr/all/conanfile.py index 1bd0db5f3ac4a..3e2a0b17b45c9 100644 --- a/recipes/soxr/all/conanfile.py +++ b/recipes/soxr/all/conanfile.py @@ -24,7 +24,7 @@ class SoxrConan(ConanFile): "with_lsr_bindings": True } generators = "cmake" - exports_sources = "patches/**" + exports_sources = ["CMakeLists.txt", "patches/**"] _cmake = None @@ -61,7 +61,7 @@ def _configure_cmake(self): self._cmake.definitions["BUILD_TESTS"] = False self._cmake.definitions["WITH_OPENMP"] = self.options.with_openmp self._cmake.definitions["WITH_LSR_BINDINGS"] = self.options.with_lsr_bindings - self._cmake.configure(source_folder=self._source_subfolder, build_folder=self._build_subfolder) + self._cmake.configure(build_folder=self._build_subfolder) return self._cmake def build(self): diff --git a/recipes/soxr/all/patches/cmake-source-dir.patch b/recipes/soxr/all/patches/cmake-source-dir.patch new file mode 100644 index 0000000000000..8e67d3f2a14de --- /dev/null +++ b/recipes/soxr/all/patches/cmake-source-dir.patch @@ -0,0 +1,12 @@ +Patch required for proper resolving of CMake modules when using the CMake conan helper wrapper. +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -84,7 +84,7 @@ mark_as_advanced (WITH_HI_PREC_CLOCK WITH_FLOAT_STD_PREC_CLOCK + + # Introspection: + +-list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) ++list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) + + include (CheckFunctionExists) + include (CheckIncludeFiles)