Changeset - 9a71bc72c092
[Not reviewed]
0 2 0
Jan Kaluza - 14 years ago 2011-06-14 11:30:41
hanzz.k@gmail.com
Use swiften-config to get libraries
2 files changed with 14 insertions and 0 deletions:
0 comments (0 inline, 0 general)
CMakeLists.txt
Show inline comments
 
@@ -35,6 +35,7 @@ find_package(Doxygen)
 
INCLUDE(FindQt4)
 
FIND_PACKAGE(Qt4 COMPONENTS QtCore)
 

	
 
# ADD_DEFINITIONS(${SWIFTEN_CFLAGS})
 

	
 
message("  Supported features")
 
message("-----------------------")
cmake_modules/SwiftenConfig.cmake
Show inline comments
 
@@ -2,6 +2,19 @@ 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()
 

	
 
	set( SWIFTEN_INCLUDE_DIR ${SWIFTEN_INCLUDE_DIR}/.. )
 
	message( STATUS "Found libSwiften: ${SWIFTEN_LIBRARY}, ${SWIFTEN_INCLUDE_DIR}")
 
	set( SWIFTEN_FOUND 1 )
0 comments (0 inline, 0 general)