Skip to content

Commit

Permalink
🐛 Fixed build with system pkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherFoxGuy committed Feb 5, 2024
1 parent 4073649 commit 2f9a5a7
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 150 deletions.
26 changes: 26 additions & 0 deletions CMake/AddMissingTargets.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
if (NOT TARGET boost::boost)
find_package(Boost REQUIRED COMPONENTS system thread filesystem)
message(STATUS "Adding boost::boost target")
add_library(boost::boost INTERFACE IMPORTED)
set_target_properties(boost::boost PROPERTIES
INTERFACE_LINK_LIBRARIES "${Boost_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
)
endif ()

if (NOT TARGET Bullet::Bullet)
message(STATUS "Adding Bullet::Bullet target")
add_library(Bullet::Bullet INTERFACE IMPORTED)
set_target_properties(Bullet::Bullet PROPERTIES
INTERFACE_LINK_LIBRARIES "${BULLET_LIBRARIES};BulletWorldImporter;BulletXmlWorldImporter"
INTERFACE_INCLUDE_DIRECTORIES "${BULLET_ROOT_DIR}/${BULLET_INCLUDE_DIR}"
)
endif ()

if (NOT TARGET rapidjson)
message(STATUS "Adding rapidjson target")
add_library(rapidjson INTERFACE IMPORTED)
set_target_properties(rapidjson PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${RAPIDJSON_INCLUDE_DIRS}"
)
endif ()
11 changes: 0 additions & 11 deletions CMake/Boost.cmake

This file was deleted.

4 changes: 3 additions & 1 deletion CMake/DependenciesConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ find_package(OpenAL REQUIRED)
find_package(RapidJSON REQUIRED)
find_package(SDL2 REQUIRED)
find_package(tinyxml2 REQUIRED)
find_package(Vorbis REQUIRED)
find_package(Vorbis REQUIRED)

include(AddMissingTargets)
49 changes: 0 additions & 49 deletions CMake/FindENet.cmake

This file was deleted.

4 changes: 2 additions & 2 deletions CMake/FindMyGUI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ find_path(MyGUI_INCLUDE_DIR MyGUI.h PATH_SUFFIXES MYGUI)

# Find release libraries
find_library(MyGUI_MyGUIEngine_LIBRARY_REL MyGUIEngine PATH_SUFFIXES release relwithdebinfo minsizerel)
find_library(MyGUI_OgrePlatform_LIBRARY_REL MyGUI.OgrePlatform PATH_SUFFIXES release relwithdebinfo minsizerel)
find_library(MyGUI_OgrePlatform_LIBRARY_REL MyGUI.Ogre2Platform PATH_SUFFIXES release relwithdebinfo minsizerel)

# Find debug libraries
find_library(MyGUI_MyGUIEngine_LIBRARY_DBG NAMES MyGUIEngine_d MyGUIEngine PATH_SUFFIXES debug)
find_library(MyGUI_OgrePlatform_LIBRARY_DBG NAMES MyGUI.OgrePlatform_d MyGUI.OgrePlatform PATH_SUFFIXES debug)
find_library(MyGUI_OgrePlatform_LIBRARY_DBG NAMES MyGUIOgre2Platform_d MyGUI.Ogre2Platform PATH_SUFFIXES debug)

# set include directories and libraries
set(MyGUI_INCLUDE_DIRS ${MyGUI_INCLUDE_DIR})
Expand Down
60 changes: 0 additions & 60 deletions CMake/FindRapidjson.cmake

This file was deleted.

1 change: 1 addition & 0 deletions CMake/Findenet.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find_with_pkg(enet "enet::enet" "libenet >= 1.3")
11 changes: 0 additions & 11 deletions CMake/dependencies-helpers/Boost.cmake

This file was deleted.

2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.22")
cmake_policy(SET CMP0127 OLD)
endif ()

set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)

include(CMakeDependentOption)
include(Macros)
include(FeatureSummary)
Expand Down
38 changes: 22 additions & 16 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,38 @@
class StuntRally3(ConanFile):
name = "StuntRally3"
settings = "os", "compiler", "build_type", "arch"
options = {
"system_pkgs": [True, False],
}
default_options = {
"bullet3/*:extras": "True",
"bullet3/*:network_support": "True",
"sdl/*:sdl2main": "False",
"system_pkgs": False,
"bullet3/*:extras": True,
"bullet3/*:network_support": True,
"sdl/*:sdl2main": False,
}

def layout(self):
self.folders.generators = os.path.join(self.folders.build, "generators")

def requirements(self):
self.requires("boost/1.83.0")
self.requires("ogre3d-next/2024.01@anotherfoxguy/stable", force=True)
self.requires("bullet3/3.25@anotherfoxguy/patched")
self.requires("sdl/2.28.5")
self.requires("mygui-next/2024.01@anotherfoxguy/stable")
self.requires("ogg/1.3.5")
self.requires("vorbis/1.3.7")
self.requires("openal-soft/1.22.2@anotherfoxguy/patched")
self.requires("enet/1.3.17")
self.requires("tinyxml2/9.0.0")
self.requires("rapidjson/cci.20230929", force=True)

self.requires("libalsa/1.2.10", override=True)
self.requires("libpng/1.6.40", override=True)
self.requires("libwebp/1.3.2", override=True)
self.requires("zlib/1.3", override=True)
if not self.options.system_pkgs:
self.requires("boost/1.83.0")
self.requires("bullet3/3.25@anotherfoxguy/patched")
self.requires("sdl/2.28.5")
self.requires("ogg/1.3.5")
self.requires("vorbis/1.3.7")
self.requires("openal-soft/1.22.2@anotherfoxguy/patched")
self.requires("enet/1.3.17")
self.requires("tinyxml2/9.0.0")
self.requires("rapidjson/cci.20230929", force=True)

self.requires("libalsa/1.2.10", override=True)
self.requires("libpng/1.6.40", override=True)
self.requires("libwebp/1.3.2", override=True)
self.requires("zlib/1.3", override=True)

def generate(self):
tc = CMakeToolchain(self)
Expand Down

0 comments on commit 2f9a5a7

Please sign in to comment.