diff --git a/cmake_modules/SwiftenConfig.cmake b/cmake_modules/SwiftenConfig.cmake index 6a2567ee10c1156f78beac53495191710838b16b..05ab853e51cd3622be1c853aa3d7a11883e7aa4e 100644 --- a/cmake_modules/SwiftenConfig.cmake +++ b/cmake_modules/SwiftenConfig.cmake @@ -2,18 +2,15 @@ FIND_LIBRARY(SWIFTEN_LIBRARY NAMES Swiften) FIND_PATH(SWIFTEN_INCLUDE_DIR NAMES "Swiften.h" PATH_SUFFIXES libSwiften Swiften ) if( SWIFTEN_LIBRARY AND SWIFTEN_INCLUDE_DIR ) -# find_program(SWIFTEN_CONFIG_EXECUTABLE NAMES swiften-config DOC "swiften-config executable") -# set( SWIFTEN_CFLAGS "" ) -# if (SWIFTEN_CONFIG_EXECUTABLE) -# execute_process( -# COMMAND swiften-config --libs -# OUTPUT_VARIABLE SWIFTEN_LIBRARY) -# execute_process( -# COMMAND swiften-config --cflags -# OUTPUT_VARIABLE SWIFTEN_CFLAGS) -# string(REGEX REPLACE "[\r\n]" " " SWIFTEN_LIBRARY "${SWIFTEN_LIBRARY}") -# string(REGEX REPLACE " +$" "" SWIFTEN_LIBRARY "${SWIFTEN_LIBRARY}") -# endif() + find_program(SWIFTEN_CONFIG_EXECUTABLE NAMES swiften-config DOC "swiften-config executable") + set( SWIFTEN_CFLAGS "" ) + if (SWIFTEN_CONFIG_EXECUTABLE) + execute_process( + COMMAND swiften-config --libs + OUTPUT_VARIABLE SWIFTEN_LIBRARY) + string(REGEX REPLACE "[\r\n]" " " SWIFTEN_LIBRARY "${SWIFTEN_LIBRARY}") + string(REGEX REPLACE " +$" "" SWIFTEN_LIBRARY "${SWIFTEN_LIBRARY}") + endif() set( SWIFTEN_INCLUDE_DIR ${SWIFTEN_INCLUDE_DIR}/.. ) message( STATUS "Found libSwiften: ${SWIFTEN_LIBRARY}, ${SWIFTEN_INCLUDE_DIR}")