Skip to content

Commit

Permalink
(#13023) assimp: fix rapidjson discovery & link
Browse files Browse the repository at this point in the history
* fix discovery & link of rapidjson

* remove requires workaroud in package_info()

it has been fixed in conan 1.51.1
  • Loading branch information
SpaceIm authored Sep 21, 2022
1 parent 50b0f93 commit 79e088a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 34 deletions.
27 changes: 1 addition & 26 deletions recipes/assimp/5.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from conans import tools as tools_legacy
import os

required_conan_version = ">=1.50.2 <1.51.0 || >=1.51.2"
required_conan_version = ">=1.51.2"


class AssimpConan(ConanFile):
Expand Down Expand Up @@ -282,28 +282,3 @@ def package_info(self):
stdcpp_library = tools_legacy.stdcpp_library(self)
if stdcpp_library:
self.cpp_info.system_libs.append(stdcpp_library)

# FIXME: shouldn't be necessary.
# It's a workaround to support conan v1 generators
self.cpp_info.requires.append("minizip::minizip")
self.cpp_info.requires.append("utfcpp::utfcpp")
if Version(self.version) < "5.1.0":
self.cpp_info.requires.append("irrxml::irrxml")
else:
self.cpp_info.requires.append("pugixml::pugixml")
if self._depends_on_kuba_zip:
self.cpp_info.requires.append("kuba-zip::kuba-zip")
if self._depends_on_poly2tri:
self.cpp_info.requires.append("poly2tri::poly2tri")
if self._depends_on_rapidjson:
self.cpp_info.requires.append("rapidjson::rapidjson")
if self._depends_on_zlib:
self.cpp_info.requires.append("zlib::zlib")
if self._depends_on_draco:
self.cpp_info.requires.append("draco::draco")
if self._depends_on_clipper:
self.cpp_info.requires.append("clipper::clipper")
if self._depends_on_stb:
self.cpp_info.requires.append("stb::stb")
if self._depends_on_openddlparser:
self.cpp_info.requires.append("openddl-parser::openddl-parser")
4 changes: 2 additions & 2 deletions recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
- INCLUDE_DIRECTORIES( "../contrib/rapidjson/include" )
- INCLUDE_DIRECTORIES( "../contrib" )
+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER)
+ find_package(rapidjson REQUIRED CONFIG)
+ find_package(RapidJSON REQUIRED CONFIG)
+ endif()
ENDIF(HUNTER_ENABLED)

Expand Down Expand Up @@ -158,7 +158,7 @@
+ target_link_libraries(assimp zip::zip)
+ endif()
+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER)
+ target_link_libraries(assimp rapidjson::rapidjson)
+ target_link_libraries(assimp rapidjson)
+ endif()
ENDIF(HUNTER_ENABLED)

Expand Down
4 changes: 2 additions & 2 deletions recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
ELSE()
- INCLUDE_DIRECTORIES("../contrib/rapidjson/include")
+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER)
+ find_package(rapidjson REQUIRED CONFIG)
+ find_package(RapidJSON REQUIRED CONFIG)
+ endif()
ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1)
option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON )
Expand Down Expand Up @@ -288,7 +288,7 @@
+ target_link_libraries(assimp openddlparser::openddlparser)
+ endif()
+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER)
+ target_link_libraries(assimp rapidjson::rapidjson)
+ target_link_libraries(assimp rapidjson)
+ endif()
+ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER)
+ target_link_libraries(assimp stb::stb)
Expand Down
4 changes: 2 additions & 2 deletions recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
ELSE()
- INCLUDE_DIRECTORIES("../contrib/rapidjson/include")
+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER)
+ find_package(rapidjson REQUIRED CONFIG)
+ find_package(RapidJSON REQUIRED CONFIG)
+ endif()
ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1)
option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON )
Expand Down Expand Up @@ -275,7 +275,7 @@
+ target_link_libraries(assimp openddlparser::openddlparser)
+ endif()
+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER)
+ target_link_libraries(assimp rapidjson::rapidjson)
+ target_link_libraries(assimp rapidjson)
+ endif()
+ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER)
+ target_link_libraries(assimp stb::stb)
Expand Down
4 changes: 2 additions & 2 deletions recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
ELSE()
- INCLUDE_DIRECTORIES("../contrib/rapidjson/include")
+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER)
+ find_package(rapidjson REQUIRED CONFIG)
+ find_package(RapidJSON REQUIRED CONFIG)
+ endif()
ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1)
option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON )
Expand Down Expand Up @@ -275,7 +275,7 @@
+ target_link_libraries(assimp openddlparser::openddlparser)
+ endif()
+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER)
+ target_link_libraries(assimp rapidjson::rapidjson)
+ target_link_libraries(assimp rapidjson)
+ endif()
+ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER)
+ target_link_libraries(assimp stb::stb)
Expand Down

0 comments on commit 79e088a

Please sign in to comment.