Split library path and libraries for swiften
This commit is contained in:
parent
da535d6bf4
commit
ab886a7ae7
1 changed files with 16 additions and 4 deletions
|
@ -7,10 +7,22 @@ if( SWIFTEN_LIBRARY AND SWIFTEN_INCLUDE_DIR )
|
|||
if (SWIFTEN_CONFIG_EXECUTABLE)
|
||||
execute_process(
|
||||
COMMAND ${SWIFTEN_CONFIG_EXECUTABLE} --libs
|
||||
OUTPUT_VARIABLE SWIFTEN_LIBRARY)
|
||||
string(REGEX REPLACE "[\r\n]" " " SWIFTEN_LIBRARY ${SWIFTEN_LIBRARY})
|
||||
string(REGEX REPLACE " +$" "" SWIFTEN_LIBRARY ${SWIFTEN_LIBRARY})
|
||||
string(REGEX REPLACE " " ";" SWIFTEN_LIBRARY ${SWIFTEN_LIBRARY})
|
||||
OUTPUT_VARIABLE SWIFTEN_LIB)
|
||||
string(REGEX REPLACE "[\r\n]" " " SWIFTEN_LIB ${SWIFTEN_LIB})
|
||||
string(REGEX REPLACE " +$" "" SWIFTEN_LIB ${SWIFTEN_LIB})
|
||||
string(REGEX REPLACE " " ";" SWIFTEN_LIB ${SWIFTEN_LIB})
|
||||
set(SWIFTEN_LIBRARY "")
|
||||
foreach(f ${SWIFTEN_LIB})
|
||||
STRING(SUBSTRING ${f} 0 2 f_out)
|
||||
STRING(COMPARE EQUAL ${f_out} "/l" IS_PATH)
|
||||
if(${IS_PATH})
|
||||
message(${f})
|
||||
string(REGEX REPLACE "/libpath:" "" f_replaced ${f})
|
||||
link_directories(${f_replaced})
|
||||
else()
|
||||
list(APPEND SWIFTEN_LIBRARY ${f})
|
||||
endif()
|
||||
endforeach(f)
|
||||
else()
|
||||
message( FATAL_ERROR "Could NOT find swiften-config" )
|
||||
endif()
|
||||
|
|
Loading…
Add table
Reference in a new issue