sofa-framework / sofa

Real-time multi-physics simulation with an emphasis on medical simulation.
https://www.sofa-framework.org
GNU Lesser General Public License v2.1
934 stars 312 forks source link

Management of the inclusion pipeline for config.h #904

Open hugtalbot opened 5 years ago

hugtalbot commented 5 years ago

We noticed using the macro SOFA_UNUSED() from the module SofaKernel/framework/sofa/simulation, the inclusion of the header <sofa/simulation/simulationcore.h> was actually not providing access to the macro.

Questions: what is the default pipeline to include config.h ? i.e. inclusion between config.h, namings of headers (config/module/initmodule.h ?) is the SOFA_UNUSED at the right location ?

@damienmarchal any idea ?


Suggested labels:

damienmarchal commented 5 years ago

Good question,

I'm not sure I have a "ready" answer but I think that the idea is that each module/plugin should have has its own config.h. This file should include the config.h from its its dependencies.

So let's take SoftRobots as an example. This SoftRobots modules we should have something like: SoftRobots/config.h And each header in this SoftRobots plugin should include SoftRobots/config.h

Now SoftRobots/config.h we should include all the config.h from the package the plugin depend on. This means that, if in the cmakelist.txt of a module/plugin we have some find_package(SofaFramework) Then in the module SoftRobots/config.h We should have something like this:

include <SofaFramework/config.h>