From 63711ff54e24865ceef859ad7fd9caf0f3fd5074 Mon Sep 17 00:00:00 2001 From: Peter Soetens Date: Thu, 26 May 2011 22:52:45 +0200 Subject: [PATCH] cmake: split lib names in .pc files since pkg-check-modules does not pick them up The pthread etc. libraries were not picked up by cmake logic from the .pc files since they were full library paths instead of path+ -llib. Signed-off-by: Peter Soetens --- config/CreatePCFlags.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/CreatePCFlags.cmake b/config/CreatePCFlags.cmake index ea957be15..28617896c 100644 --- a/config/CreatePCFlags.cmake +++ b/config/CreatePCFlags.cmake @@ -43,8 +43,10 @@ macro( create_pc_flags CM_DEFINES CM_INCLUDES CM_LIBRARIES PC_DEFINES PC_INCLUDE endif() if( ITEM ) get_filename_component(PC_LIBPATH ${ITEM} PATH) - if (PC_LIBPATH) - set( ${PC_LIBRARIES} "${${PC_LIBRARIES}} ${ITEM}") + get_filename_component(PC_LIB ${ITEM} NAME_WE) + if (PC_LIBPATH AND PC_LIB) + string(REPLACE "lib" "" PC_LIB ${PC_LIB}) + set( ${PC_LIBRARIES} "${${PC_LIBRARIES}} -L${PC_LIBPATH} -l${PC_LIB}") else() set( ${PC_LIBRARIES} "${${PC_LIBRARIES}} -l${ITEM}") endif()