Skip to content

Commit

Permalink
Use CMake conan helper wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
chausner committed Oct 22, 2021
1 parent 43a9c26 commit 375aca0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
7 changes: 7 additions & 0 deletions recipes/soxr/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 2.8.11)
project(cmake_wrapper)

include(conanbuildinfo.cmake)
conan_basic_setup()

add_subdirectory("source_subfolder")
2 changes: 2 additions & 0 deletions recipes/soxr/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions recipes/soxr/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SoxrConan(ConanFile):
"with_lsr_bindings": True
}
generators = "cmake"
exports_sources = "patches/**"
exports_sources = ["CMakeLists.txt", "patches/**"]

_cmake = None

Expand Down Expand Up @@ -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):
Expand Down
12 changes: 12 additions & 0 deletions recipes/soxr/all/patches/cmake-source-dir.patch
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 375aca0

Please sign in to comment.