[CMake] Policy to forbid linking with non-cmake-targets

Patrick Boettcher patrick.boettcher at posteo.de
Mon Dec 12 07:10:21 EST 2016


Hi list,

is there a policy which can be enabled to forbid calling 

  target_link_libraries(foo bar)

where bar is _not_ a known cmake target?

Right now, if 'bar' is not a cmake-target cmake tries to link with
-lbar (on linux). Can I inhibit this behavior in any way?

I'd prefer cmake telling me that this target is unknown rather than
receiving a link error at the end of the build-process.

Thanks,
--
Patrick.



More information about the CMake mailing list