Allow use of local targets instead of imported ones
To support the LHCb satellite projects use case, I added the option GAUDI_PREFER_LOCAL_TARGETS
. When it's set to true, the arguments to the LINK
option of gaudi_add_*
commands will drop the namespace part of the target if a local target with the same name exist.
So if an already processed subdirectory defines the library MyStuff
, the following code
set(GAUDI_PREFER_LOCAL_TARGETS TRUE)
gaudi_add_library(MyOtherStuff SOURCES src/abc.cpp
LINK PUBLIC SomeProject::MyStuff)
will be equivalent to
set(GAUDI_PREFER_LOCAL_TARGETS TRUE)
gaudi_add_library(MyOtherStuff SOURCES src/abc.cpp
LINK PUBLIC MyStuff)
The option GAUDI_PREFER_LOCAL_TARGETS
is OFF by default.
Edited by Marco Clemencic