🔨 Use find_package instead of cmake_paths

This commit is contained in:
Edgar 2021-09-03 11:09:20 +00:00 committed by GitHub
parent b08b2caabe
commit 3a4d4f50bb
4 changed files with 30 additions and 19 deletions

View File

@ -7,7 +7,7 @@ class CaelumConan(ConanFile):
url = "https://github.com/RigsOfRods/Caelum/issues"
description = "Caelum is a library which provides cross-platform socket abstraction"
settings = "os", "compiler", "build_type", "arch"
generators = "cmake_paths"
generators = "cmake_find_package"
exports_sources = "patches/**"
def requirements(self):
@ -29,6 +29,7 @@ class CaelumConan(ConanFile):
cmake.install()
def package_info(self):
self.cpp_info.name = "Caelum"
self.cpp_info.includedirs = [
'include',
'include/Caelum'
@ -36,5 +37,4 @@ class CaelumConan(ConanFile):
self.cpp_info.libs = tools.collect_libs(self)
def package_id(self):
self.cpp_info.name = "Caelum"
self.info.requires["ogre3d"].full_recipe_mode()

View File

@ -1,14 +1,15 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -9,6 +9,7 @@
cmake_minimum_required(VERSION 3.0.2)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
@@ -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)
+include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
# add some functions we use that are shipped with cmake
INCLUDE(CheckLibraryExists)
@@ -18,7 +19,7 @@
@@ -18,7 +18,7 @@
INCLUDE(CheckCSourceCompiles)
# define the project
@ -16,4 +17,13 @@
+project(Caelum VERSION 0.6.4)
# some versioning things
SET(LIB_MAJOR_VERSION ${Caelum_VERSION_MAJOR})
SET(LIB_MAJOR_VERSION ${Caelum_VERSION_MAJOR})
@@ -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

View File

@ -1,13 +1,13 @@
from conans import ConanFile, CMake, tools
class CaelumConan(ConanFile):
class PagedGeometryConan(ConanFile):
name = "ogre3d-pagedgeometry"
license = "GNU Lesser General Public License v2.1"
url = "https://github.com/RigsOfRods/Caelum/issues"
description = "PagedGeometry is a plugin for OGRE for rendering of dense vegetation "
settings = "os", "compiler", "build_type", "arch"
generators = "cmake_paths"
generators = "cmake_find_package"
exports_sources = "patches/**"
def requirements(self):
@ -29,6 +29,7 @@ class CaelumConan(ConanFile):
cmake.install()
def package_info(self):
self.cpp_info.name = "PagedGeometry"
self.cpp_info.includedirs = [
'include',
'include/PagedGeometry'
@ -36,5 +37,4 @@ class CaelumConan(ConanFile):
self.cpp_info.libs = tools.collect_libs(self)
def package_id(self):
self.cpp_info.name = "PagedGeometry"
self.info.requires["ogre3d"].full_recipe_mode()

View File

@ -1,14 +1,15 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -9,6 +9,7 @@
cmake_minimum_required( VERSION 3.0.2 )
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake )
@@ -7,7 +7,7 @@
# cmake system for PagedGeometry 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 )
+include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
# add some functions we use that are shipped with cmake
INCLUDE(CheckLibraryExists)
@@ -20,7 +21,7 @@
@@ -20,7 +20,7 @@
# some versioning things
SET(LIB_MAJOR_VERSION "1")
SET(LIB_MINOR_VERSION "2")
@ -16,4 +17,4 @@
+SET(LIB_BUILD_VERSION "1")
SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_BUILD_VERSION}")
IF(NOT DEFINED LIB_INSTALL_DIR)
SET(LIB_INSTALL_DIR "lib${LIB_SUFFIX}")
SET(LIB_INSTALL_DIR "lib${LIB_SUFFIX}")