Skip to content
Snippets Groups Projects
Commit 134a3816 authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

fix issue that a double "-l" can appear in the Makefile config shell scripts...

fix issue that a double "-l" can appear in the Makefile config shell scripts for libraries which already contain the -l
parent 4ea0c0cd
No related branches found
No related tags found
No related merge requests found
......@@ -44,9 +44,11 @@ endforeach()
string(REPLACE " " ";" LIST "${PROJECT_NAME} ${${PROJECT_NAME}_LIBRARIES}")
foreach(LIBRARY ${LIST})
if(LIBRARY MATCHES "/") # library name contains slashes: link against the a file path name
if(LIBRARY MATCHES "/") # library name contains slashes: link against the a file path name
set(${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE "${${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE} ${LIBRARY}")
else() # library name does not contain slashes: link against library with -l option
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}")
else() # link against library with -l option
set(${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE "${${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE} -l${LIBRARY}")
endif()
endforeach()
......
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