Stephen Kelly wrote:
> 1) Policy
>
> The include directories and compile definitions are set by the
> target_link_libraries command. It might make sense to add a policy for
> that feature, as otherwise the order of include directories would change,
> eg:
>
> add_executable(foo ...)
> target_link_libraries(foo bar bat)
> include_directories(${bat_INCLUDE_DIRS} ${bar_INCLUDE_DIRS})
>
I'd like to return to this issue.
add_executable(foo ...)
target_link_libraries(foo bar bat)
include_directories(${bat_INCLUDE_DIRS} ${bar_INCLUDE_DIRS})
will generate
-Ibat -Ibar
before my topic, and
-Ibar -Ibat
afterward.
I think I can add a policy for this by keeping track of whether each include
came from a tll() call or another method. If another method tries to add an
include which is already there, check if it is there because of a tll()
call, and if it is, remove it from there and append it in the new call.
This will require that the INCLUDE_DIRECTORIES properties not be handled in
the regular way, but as a std::vector<IncludeDirectoryEntry> where:
struct IncludeDirectoryEntry
{
cmCompiledGeneratorExpression ge;
bool IsCMP0020Entry;
};
On the plus-side this means that we'll get proper backtraces from errors in
generator expressions for includes.
Any thoughts on that?
Thanks,
Steve.
--
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