Skip to content

Commit

Permalink
cmake: split lib names in .pc files since pkg-check-modules does not …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
Peter Soetens committed May 26, 2011
1 parent 9b70629 commit 63711ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/CreatePCFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 63711ff

Please sign in to comment.