GeneratePkgConfig: fix absolute path handling.
GitOrigin-RevId: b5cdd94ca3b8c90781fd6101ab4ed58b159344fe
This commit is contained in:
parent
f08e0fb116
commit
3d52512d26
@ -6,6 +6,17 @@ function(get_relative_link OUTPUT PATH)
|
||||
string(REGEX REPLACE "^[$]<[$]<NOT:[$]<CONFIG:DEBUG>>:(.*)>$" "\\1" PATH "${PATH}")
|
||||
|
||||
get_filename_component(NAME "${PATH}" NAME_WE)
|
||||
if (IS_ABSOLUTE ${PATH})
|
||||
get_filename_component(DIRECTORY_NAME "${PATH}" DIRECTORY)
|
||||
if (WIN32)
|
||||
set(${OUTPUT} "-l\"${DIRECTORY_NAME}/${NAME}\"" PARENT_SCOPE)
|
||||
else()
|
||||
get_filename_component(FULL_NAME "${PATH}" NAME)
|
||||
set(${OUTPUT} "-L\"${DIRECTORY_NAME}\" -l:${FULL_NAME}" PARENT_SCOPE)
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (NOT WIN32 AND NAME MATCHES "^lib")
|
||||
string(REGEX REPLACE "^lib" "-l" LINK "${NAME}")
|
||||
elseif (NAME MATCHES "^-")
|
||||
|
Loading…
Reference in New Issue
Block a user