On 02/11/2013 02:18 PM, Stephen Kelly wrote:
> Would cmCoreTryCompile also generate a target_link_libraries line for the 
> targets after the existing target_link_libraries line?
> 
> Otherwise using the raw try_compile would not do what you expect:

I wouldn't expect TARGETS to be linked.

>  try_compile( ... TARGETS foo ...)
>  # Generates an imported target for foo, but does not link to it.
> 
> What effect would the TARGETS parameter have in 'full project' mode?

In both cases I'm picturing that TARGETS will merely make the targets
available in the test project.  It doesn't do anything with them.

Especially in the case of a full project we wouldn't know what to do
with them anyway.

For the single-source signature I could see adding a bunch of modern
keyword arguments like INCLUDE_DIRECTORIES, LINK_LIBRARIES, etc.
that essentially turn into the corresponding properties on the
generated project's test target.  They would replace the current
-D convention which pre-dated keyword arguments in CMake.  The outer
try_compile call would handle target exports for LINK_LIBRARIES.

-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