I have some debugging information in CMake to check if I added the right information when compiling the project. This piece of code works correctly:
# Include DIRECTORIES GET_PROPERTY(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) FOREACH(dir ${dirs}) MESSAGE(STATUS " * Include directory: '${dir}'") ENDFOREACH()
But when I try to check all the libraries related in the current project, I get an empty variable:
# Linking against GET_PROPERTY(libtargets DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY LINK_LIBRARIES) MESSAGE("Libs: ${libtargets}") FOREACH(libtarget ${libtargets}) MESSAGE(STATUS " * Target Link library: '${libtarget}'") ENDFOREACH()
Checking the CMake 3.0 documentation seems to be fine, but I don't know what values ββare readable. I am printing information AFTER manufacturing ADD_LIBRARY / ADD_EXECUTABLE
Is LINK_LIBRARIES wrong value for GET_PROPERTY ? How can I get this information?
source share