On 11/7/2011 10:18 AM, Stephen Kelly wrote:
Ok, thanks. Seems like an important thing to document. Is there any page
showing how to use config files and targets files?

http://www.cmake.org/Wiki/CMake/Tutorials#CMake_Packages

This section:

  http://www.cmake.org/Wiki/CMake/Tutorials/Packaging#Packaging_and_Exporting

could be updated with that suggestion.

if (NOT TARGET grantlee_templates)
    ADD_LIBRARY(grantlee_templates SHARED IMPORTED)
endif()

This would hide cases of accidentally conflicting target names.

I don't understand.

If an application defines a target named "foo" as part of its own build
and then uses find_package to load a dependency that also defines "foo"
then a target-wise blocker like the above will silently skip the imported
target.  Then the imported dependency won't link correctly because it
will use the application's foo instead of the package's foo.  We need to
allow the add_library command to complain about an existing target.

-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