Commit d2eecd20 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Factorize GenPKGConfig

parent e2d105dc
......@@ -101,11 +101,10 @@ macro(gpc_convert_libstyle_to_pkgconfig _liblist)
if (${_dep} MATCHES "^/")
get_filename_component(dep_libname ${_dep} NAME)
get_filename_component(dep_libdir ${_dep} PATH)
string(REPLACE ".so" "" dep_libname "${dep_libname}")
string(REPLACE ".a" "" dep_libname "${dep_libname}")
string(REPLACE ".dylib" "" dep_libname "${dep_libname}")
string(REPLACE ".dll" "" dep_libname "${dep_libname}")
string(REPLACE "lib" "" dep_libname "${dep_libname}")
foreach( _ext ${CMAKE_FIND_LIBRARY_SUFFIXES} )
string(REPLACE "${_ext}$" "" dep_libname "${dep_libname}")
endforeach()
string(REPLACE "^lib" "" dep_libname "${dep_libname}")
list(APPEND ${_liblist} -L${dep_libdir} -l${dep_libname})
elseif(NOT ${_dep} MATCHES "^-")
list(APPEND ${_liblist} "-l${_dep}")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment