Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a70a39d2 authored by PRUVOST Florent's avatar PRUVOST Florent
Browse files

GenPkgConfig.cmake: fix windows case and add comments

parent 82c7055b
No related branches found
No related tags found
No related merge requests found
......@@ -97,8 +97,10 @@ macro(gpc_convert_libstyle_to_pkgconfig _liblist)
# Convert to pkg-config file format
set(${_liblist}_CPY "${${_liblist}}")
set(${_liblist} "")
# we consider a list of libraries as input
foreach(_dep ${${_liblist}_CPY})
if (${_dep} MATCHES "^/")
if (${_dep} MATCHES "^/|^[A-Z]:/")
# case library is an absolute path (e.g. /opt/foo/lib/libfoo.so)
get_filename_component(dep_libname ${_dep} NAME)
get_filename_component(dep_libdir ${_dep} PATH)
foreach( _ext ${CMAKE_FIND_LIBRARY_SUFFIXES} )
......@@ -106,10 +108,12 @@ macro(gpc_convert_libstyle_to_pkgconfig _liblist)
endforeach()
string(REGEX REPLACE "^lib" "" dep_libname "${dep_libname}")
list(APPEND ${_liblist} -L${dep_libdir} -l${dep_libname})
elseif(NOT ${_dep} MATCHES "^-")
list(APPEND ${_liblist} "-l${_dep}")
else()
elseif(${_dep} MATCHES "^-l")
# case library given with -l (e.g. -lfoo)
list(APPEND ${_liblist} ${_dep})
else()
# case library given by name (e.g. foo)
list(APPEND ${_liblist} "-l${_dep}")
endif()
endforeach()
endmacro(gpc_convert_libstyle_to_pkgconfig)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment