diff --git a/ogre-caelum/all/conandata.yml b/ogre-caelum/all/conandata.yml index 22985b2..25fb075 100644 --- a/ogre-caelum/all/conandata.yml +++ b/ogre-caelum/all/conandata.yml @@ -7,4 +7,7 @@ sources: sha256: "deffe26ba169d89954f62ade50e856fdae293078c73836378d7bf3051eff0a8d" "2022.08": url: "https://github.com/OGRECave/ogre-caelum/archive/4bd1b0581d55896d37922483981582661ca557de.zip" - sha256: "deffe26ba169d89954f62ade50e856fdae293078c73836378d7bf3051eff0a8d" \ No newline at end of file + sha256: "deffe26ba169d89954f62ade50e856fdae293078c73836378d7bf3051eff0a8d" +patches: + "2022.08": + - patch_file: "patches/2022.08/CMakeLists.txt.patch" \ No newline at end of file diff --git a/ogre-caelum/all/conanfile.py b/ogre-caelum/all/conanfile.py index b4c6cbb..23b93f2 100644 --- a/ogre-caelum/all/conanfile.py +++ b/ogre-caelum/all/conanfile.py @@ -1,8 +1,14 @@ from conan import ConanFile -from conan.tools.files import get, collect_libs, replace_in_file +from conan.tools.files import ( + get, + collect_libs, + apply_conandata_patches, + export_conandata_patches, +) from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout import os + class CaelumConan(ConanFile): name = "ogre3d-caelum" license = "GNU Lesser General Public License v2.1" @@ -10,6 +16,9 @@ class CaelumConan(ConanFile): description = "Library for rendering of dynamic and realistic skies" settings = "os", "compiler", "build_type", "arch" + def export_sources(self): + export_conandata_patches(self) + def layout(self): cmake_layout(self) @@ -27,11 +36,7 @@ class CaelumConan(ConanFile): deps.generate() def _patch_sources(self): - replace_in_file(self, - os.path.join(self.source_folder, "main/CMakeLists.txt"), - "OgreMain", - "OGRE::OGRE", - ) + apply_conandata_patches(self) def build(self): self._patch_sources() @@ -48,10 +53,7 @@ class CaelumConan(ConanFile): self.cpp_info.set_property("cmake_module_target_name", "Caelum::Caelum") self.cpp_info.set_property("cmake_file_name", "Caelum") self.cpp_info.set_property("cmake_target_name", "Caelum::Caelum") - self.cpp_info.includedirs = [ - 'include', - 'include/Caelum' - ] + self.cpp_info.includedirs = ["include", "include/Caelum"] self.cpp_info.libs = collect_libs(self) def package_id(self): diff --git a/ogre-caelum/all/patches/0.6.3/CMakeLists.txt.patch b/ogre-caelum/all/patches/0.6.3/CMakeLists.txt.patch deleted file mode 100644 index 99c04a3..0000000 --- a/ogre-caelum/all/patches/0.6.3/CMakeLists.txt.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -7,7 +7,7 @@ - # cmake system for Caelum updated on 6-10-2017 by Edgar{at}AnotherFoxGuy{DOT}com - - cmake_minimum_required(VERSION 3.0.2) --set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) -+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake) - - - # add some functions we use that are shipped with cmake -@@ -34,7 +34,7 @@ - - SET(CMAKE_USE_RELATIVE_PATHS OFF) - --find_package(OGRE REQUIRED CONFIG) -+find_package(OGRE REQUIRED) - link_directories(${OGRE_LIBRARY_DIRS}) - - # setup paths diff --git a/ogre-caelum/all/patches/2022.08/CMakeLists.txt.patch b/ogre-caelum/all/patches/2022.08/CMakeLists.txt.patch index 5fa0956..94dfeb9 100644 --- a/ogre-caelum/all/patches/2022.08/CMakeLists.txt.patch +++ b/ogre-caelum/all/patches/2022.08/CMakeLists.txt.patch @@ -1,25 +1,8 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -8,6 +8,8 @@ +--- a/main/CMakeLists.txt ++++ b/main/CMakeLists.txt +@@ -34,4 +34,4 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/main/include/ DESTINATION ${CMAKE_INSTALL_ + install(DIRECTORY ${CMAKE_BINARY_DIR}/main/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Caelum FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE) - cmake_minimum_required(VERSION 3.0.2) - -+set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH}) -+set(CMAKE_DEBUG_POSTFIX _d) - # define the project - project( - Caelum -@@ -29,7 +31,12 @@ - - SET(CMAKE_USE_RELATIVE_PATHS OFF) - --find_package(OGRE REQUIRED CONFIG) -+find_package(OGRE REQUIRED) -+ -+add_library(OgreMain INTERFACE IMPORTED GLOBAL) -+target_include_directories(OgreMain INTERFACE ${OGRE_INCLUDE_DIRS}) -+target_link_libraries(OgreMain INTERFACE ${OGRE_LIBRARIES}) -+ - - # setup paths - SET(RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/") \ No newline at end of file + # --- Ogre 3D graphics engine --- +-target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC OgreMain) ++target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC OGRE::OGRE)