Alexander Neundorf wrote: > With PUBLIC, PRIVATE and INTERFACE, > directories can be added to the wrong one (i.e. PUBLIC instead PRIVATE or > INTERFACE) and it will still build, but the interface will be bigger than > necessary.
Would it be reasonable to issue an error at install(EXPORT)-time if the INTERFACE_INCLUDE_DIRECTORIES of a target contains paths in the source dir or binary dir, if the install prefix is not inside one of those itself? That way, something like this would be an error at install-export-time: target_include_directories(foo # Forgot to wrap in BUILD_INTERFACE: INTERFACE "${CMAKE_CURRENT_BINARY_DIR}") Also, in cmTarget::GetIncludeDirectories, if a path in a INTERFACE_INCLUDE_DIRECTORIES entry of an IMPORTED dependent does not exist, that could be made an error too. This would sort of be showing the error in the wrong place though (to the person using the package, rather than the one creating it). 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