Make assimp build cherry-picked importers in CMake
authorAlberto Taiuti <alberto.taiuti@gmail.com>
Sat, 12 Nov 2016 01:29:46 +0000 (01:29 +0000)
committerAlberto Taiuti <alberto.taiuti@gmail.com>
Sat, 12 Nov 2016 02:04:05 +0000 (02:04 +0000)
commit70d5bb8c7b8e0767892326398f3bdec0e2f0c27b
tree759f7822daba1e5104372c25ac5a5e5e4431879f
parentfdd01bda8343b65981498d3c96d8d253290e4b99
Make assimp build cherry-picked importers in CMake

Modify assimp's cmake to exclude the build of all the importers
by default; the user has then to manually select the ones needed
by setting the relative option.

From the explanation as written in the CMakeLists itself:

---
This option allows to select whether to build all the importers and then
manually select which ones not to build (old behaviour), or if to
exclude all importers from build and manually select the ones to actually
build.
By default, exclude all importers and manually select which ones to use.

To have all importers excluded, simply do not set this option in the parent
CmakeLists. Then, set the option for the importer(s) needed in the parent
CMakeLists, e.g.:
   OPTION(ASSIMP_BUILD_OBJ_IMPORTER "" TRUE)

To have assimp build all the importers, set the option to true, then manually
exclude which importers you don't need, e.g.:
   OPTION(ASSIMP_BUILD_OBJ_IMPORTER "" FALSE)

NOTE: In order to use this method of exclusion, the tools build must be disabled;
their code references certain importers/exporters which would be excluded.
If you need the tools, either manually add the importers/exporters the code
references (you will see linkage errors), or just enable the build of all the
importers as explained above.
---

As mentioned there, set the main CMakeLists not to build the tools and
the tests by default, since they use certain exporters and importers
which, with this method, are not necessarily used/built.
CMakeLists.txt
code/CMakeLists.txt