Hello,

Is there a way to get the effective include directories and compile
definitions for a target, including those specified at the directory level
and any INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITION on
targets that are required via target_link_libraries?

Iterating recursively over LINK_LIBRARIES to find interface
include/definition is the alternative, but I guess I'd need to handle
non-target dependencies, as well as possible cyclic dependencies.

Ideas?

Example:

include_directories(/path/to/common)
add_definitions(-DCOMMON=1)

add_library(lib1 lib1.c)
target_include_directories(lib1 PUBLIC /path/to/lib1)
target_compile_definitions(lib1 PUBLIC -DLIB1=1)

add_library(lib2 lib2.c)
target_include_directories(lib2 PUBLIC /path/to/lib2)
target_compile_definitions(lib2 PUBLIC -DLIB2=1)

target_link_libraries(lib2 lib1)

How would I get all 3 include directories and definitions for lib2 into
variables? The INCLUDE_DIRECTORIES property on the lib2 target only
includes the common and lib2-specific include directory, while the
COMPILE_DEFINITIONS property only includes the specific definition, not
even the directory-level definition (COMMON).

I'm trying to generate PC-Lint configuration files and need the definitions
and include directories. The wiki solution no longer works with interface
include_directories and compile_definitions.

Lars
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to