When dealing with system libraries which are absolute paths, use the
absolute path rather than the `-l` option. This ensures that the system
library can be properly linked against. This is needed to enable using
proper link dependencies in CMake.
set(SYSTEM_LIBS ${SYSTEM_LIBS} "${l}")
else()
# Otherwise assume it's a library name we need to link with.
- set(SYSTEM_LIBS ${SYSTEM_LIBS} "-l${l}")
+ if(IS_ABSOLUTE ${l})
+ set(SYSTEM_LIBS ${SYSTEM_LIBS} "${l}")
+ else()
+ set(SYSTEM_LIBS ${SYSTEM_LIBS} "-l${l}")
+ endif()
endif()
endif()
endforeach()