On 02/11/2013 01:34 PM, Stephen Kelly wrote:
> I also considered splitting the targets from the non-targets in the 
> implementation of the macros. That would mean changing the order of the 
> content of target_link_libraries calls generated by cmCoreTryCompile because 
> we would have two lists send from the macros to try_compile (one of 
> libraries, the other of targets). That would maybe need a policy.

I don't think we need to split anything.  The macros can pass everything
in ${CMAKE_REQUIRED_LIBRARIES} to -DLINK_LIBRARIES and take the targets
out of it to pass to a TARGETS argument for transformation.  The latter
would handle the export/import and the former would work as it does now
but without CMakeExpandImportedTargets.

> I wonder if we can detect dangerous code:
> 
>  export(TARGETS foo bar NAMESPACE exp_)
>  try_compile( ... TARGETS exp_foo exp_bar)

The export() command won't make the exp_ targets available in the current
project.  It would have to load the targets file to do that, and IMO then
the project is on its own, especially since we want to disallow that
behavior with a policy later.

-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to