Skip to content
Snippets Groups Projects
Commit c2027f8f authored by Jens Georg's avatar Jens Georg
Browse files

Resolve cmake targets in the config scripts

THis is necessary for newer Boost (1.71) which puts the exported targets
in Boost_LIBRARIES. If we export that verbatim it causes link issues on
projects using the config scripts from Make
parent 49570d5a
No related branches found
Tags 00.05.00
No related merge requests found
......@@ -48,6 +48,9 @@ foreach(LIBRARY ${LIST})
set(${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE "${${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE} ${LIBRARY}")
elseif(LIBRARY MATCHES "^-l") # library name does not contain slashes but already the -l option: directly quote it
set(${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE "${${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE} ${LIBRARY}")
elseif(LIBRARY MATCHES "::") # library name is an exported target - we need to resolve it for Makefiles
get_property(lib_loc TARGET ${LIBRARY} PROPERTY LOCATION)
string(APPEND ${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE " ${lib_loc}")
else() # link against library with -l option
set(${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE "${${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE} -l${LIBRARY}")
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment