Skip to content

Conversation

@rbsheth
Copy link
Contributor

@rbsheth rbsheth commented May 24, 2019

Assimp has a lot of dependencies, copied into the repo at contrib/. The Hunter package manager (https://github.com/ruslo/hunter) helps manage such a dependency tree, as well as potential integration into other projects.

As mentioned in #1946, there is a fork of Assimp in Hunter but it is quite dated: https://github.com/hunter-packages/assimp.

This PR adds support for the Hunter package manager in Assimp, using it to resolve and pull in dependencies only when the HUNTER_ENABLED CMake argument is set. By default, HUNTER_ENABLED is set to OFF and the current CMake behavior is preserved.

This PR does a few things besides adding the requisite Hunter-related CMake files if HUNTER_ENABLED=ON:

  1. Disable setting of important toolchain-wide flags (like -std=cxx11 and -fPIC) as they will be set externally
  2. Download and link against dependent packages through Hunter
  3. Define ASSIMP_USE_HUNTER and rewrite include paths for dependencies if set
  4. Create a Hunter-compatible CMake config file for easy library consumption

What's missing:
Open3DGC - I haven't added this to Hunter and disabled it in Assimp for Hunter builds. For glTF 2.0, perhaps Draco is more widely supported and I have added that to Hunter so it would be pretty easy to add to Assimp.
Testing of tools/samples/tests - I focused on incorporating the library build for use in the package manager.

As a sanity check, I was able to build the library after completely removing the contrib/ directory.

@rahulshethsc rahulshethsc force-pushed the rbsheth_hunterize_assimp branch from b36cd33 to d00f4f4 Compare June 14, 2019 04:35
@rbsheth
Copy link
Contributor Author

rbsheth commented Jun 14, 2019

@kimkulling Any thoughts on this?

@kimkulling
Copy link
Member

For me it looks fine as a prototype test, which could get enabled on master. I also played around with Conan, but there aren't any working results out there until now.

Let me do the code review and then I will merge it, if no one else has any concerns.

@mlfarrell
Copy link

Few notes from myself. Personally, I don’t update my assimp version as much as I should. Namely because when I do, I have to (re)build it so many times for so many different systems. iOS, Android, Windows store (arm,x86,x64), mac, windows desktop, etc.

So, I’m on board with a new dependency manager as long as it doesn’t impede my ability to use CMake to build assimp again for the above systems.

Just my two cents.

@kimkulling kimkulling merged commit 2d3c337 into assimp:master Jun 15, 2019
@kimkulling
Copy link
Member

Merged, let's see!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants