From 49ace14eb5f28cd3dd70d06d434daf830fc89e77 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Sat, 16 Jul 2022 06:35:29 -0500 Subject: [PATCH] Add CMake wrapper --- recipes/dbus/1.x.x/CMakeLists.txt | 8 ++++++++ recipes/dbus/1.x.x/conanfile.py | 11 ++--------- 2 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 recipes/dbus/1.x.x/CMakeLists.txt diff --git a/recipes/dbus/1.x.x/CMakeLists.txt b/recipes/dbus/1.x.x/CMakeLists.txt new file mode 100644 index 0000000000000..5921f020dddbb --- /dev/null +++ b/recipes/dbus/1.x.x/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/cmake/modules") +add_subdirectory("source_subfolder/cmake") diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py index 2a9c37884e125..ac0e582849b6b 100644 --- a/recipes/dbus/1.x.x/conanfile.py +++ b/recipes/dbus/1.x.x/conanfile.py @@ -19,6 +19,7 @@ class DbusConan(ConanFile): topics = ("dbus") settings = "os", "arch", "compiler", "build_type" + exports_sources = ["CMakeLists.txt"] options = { "system_socket": "ANY", "system_pid_file": "ANY", @@ -82,18 +83,10 @@ def _configure_cmake(self): # Define EXPAT_LIBRARIES to be the expat::expat target provided by Conan to fix linking. self._cmake.definitions["EXPAT_LIBRARIES"] = "expat::expat" - path_to_cmake_lists = os.path.join(self._source_subfolder, "cmake") - - self._cmake.configure(source_folder=path_to_cmake_lists, - build_folder=self._build_subfolder) + self._cmake.configure(build_folder=self._build_subfolder) return self._cmake def build(self): - replace_in_file( - self, - os.path.join(self._source_subfolder, "cmake", "CMakeLists.txt"), - "project(dbus)", - "project(dbus)\ninclude(../../conanbuildinfo.cmake)\nconan_basic_setup()") cmake = self._configure_cmake() cmake.build()