Package module as "IMPORTED" cmake targets
The current cmake targets of OTB are packaged in Core. This is a problem if we want to separate OTB module.
Some modules depends of other OTB modules, thus when we want to build them, we need OTB Core and the package of these modules installed. But if OTB Core is build without any OTBGroup, the cmake targets of theses dependencies are not declared.
One solution could be to create an OTB Core package with options -DOTBGroup corresponding to dependencies, but it lead to one specific OTB build per module. This is not a durable solution as it complexify CI, increase build time, is source of errors etc...
CMake propose a solution: IMPORTED_TARGETS: https://cmake.org/cmake/help/latest/guide/importing-exporting/index.html . This can help to have cmake target of each package/module in the module package itself instead of Core package.
-
OTB should compile like before (in a single package) -
Project should compile and each package must include its own Target and Config file -
External project should compile like before with OTB, if build in one or many packages -
External project should compile with OTB separated in many packages