From 1fa2297e126d6d7a677622f8ff6265dccd3dbc53 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Tue, 15 Feb 2011 14:57:10 +0100 Subject: [PATCH] Add FindGloox.cmake and make use of it. --- CMakeLists.txt | 1 + CMakeModules/FindGloox.cmake | 23 +++++++++++++++++++++++ src/CMakeLists.unix.txt | 4 +--- src/CMakeLists.win32.txt | 2 +- src/sip/jabber/CMakeLists.txt | 7 +------ 5 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 CMakeModules/FindGloox.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index d0db60c62..11f6b9111 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ check_taglib_filename( COMPLEX_TAGLIB_FILENAME ) FIND_PACKAGE( LibLastFm 0.3.3 REQUIRED ) FIND_PACKAGE( LibEchonest 1.1.1 REQUIRED ) FIND_PACKAGE( CLucene REQUIRED ) +FIND_PACKAGE( Gloox 1.0 REQUIRED ) IF( UNIX AND NOT APPLE ) ADD_SUBDIRECTORY( alsa-playback ) diff --git a/CMakeModules/FindGloox.cmake b/CMakeModules/FindGloox.cmake new file mode 100644 index 000000000..ccdbdcfbf --- /dev/null +++ b/CMakeModules/FindGloox.cmake @@ -0,0 +1,23 @@ +# - Try to find GLOOX +# Find GLOOX headers, libraries and the answer to all questions. +# +# GLOOX_FOUND True if gloox got found +# GLOOX_INCLUDE_DIR Location of gloox headers +# GLOOX_LIBRARIES List of libaries to use gloox +# +# Copyright (c) 2009 Nigmatullin Ruslan +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +FIND_PATH( GLOOX_INCLUDE_DIR "gloox/gloox.h" ) +FIND_LIBRARY( GLOOX_LIBRARIES gloox ) + +if( GLOOX_LIBRARIES AND GLOOX_INCLUDE_DIR ) + message( STATUS "Found gloox: ${GLOOX_LIBRARIES}" ) + set( GLOOX_FOUND 1 ) +else( GLOOX_LIBRARIES AND GLOOX_INCLUDE_DIR ) + message( STATUS "Could NOT find gloox" ) +endif( GLOOX_LIBRARIES AND GLOOX_INCLUDE_DIR ) diff --git a/src/CMakeLists.unix.txt b/src/CMakeLists.unix.txt index 9cbded495..d28e33558 100644 --- a/src/CMakeLists.unix.txt +++ b/src/CMakeLists.unix.txt @@ -4,11 +4,9 @@ ADD_DEFINITIONS( -g ) ADD_DEFINITIONS( -fno-operator-names ) ADD_DEFINITIONS( -fPIC ) -SET( GLOOX_LIBS ${GLOOX_LIBS} resolv gloox ) - SET( OS_SPECIFIC_LINK_LIBRARIES ${LIBLASTFM_LIBRARY} - ${GLOOX_LIBS} + ${GLOOX_LIBRARIES} qxtweb-standalone ) diff --git a/src/CMakeLists.win32.txt b/src/CMakeLists.win32.txt index 0e152d30e..e4cced677 100644 --- a/src/CMakeLists.win32.txt +++ b/src/CMakeLists.win32.txt @@ -13,7 +13,7 @@ SET( OS_SPECIFIC_LINK_LIBRARIES # normal deps ${LIBLASTFM_LIBRARY} - ${GLOOX_LIBS} + ${GLOOX_LIBRARIES} # third party shipped with tomahawk ${CMAKE_BINARY_DIR}/thirdparty/qtweetlib/libtomahawk_qtweetlib.dll diff --git a/src/sip/jabber/CMakeLists.txt b/src/sip/jabber/CMakeLists.txt index be9ccb02b..f8d35ca20 100644 --- a/src/sip/jabber/CMakeLists.txt +++ b/src/sip/jabber/CMakeLists.txt @@ -24,11 +24,6 @@ qt4_wrap_cpp( jabberMoc ${jabberHeaders} ) add_library( sip_jabber SHARED ${jabberSources} ${jabberMoc} ) IF( WIN32 ) -SET( GLOOX_LIBS - ${GLOOX_LIBS} - gloox -) - SET( OS_SPECIFIC_LINK_LIBRARIES ${OS_SPECIFIC_LINK_LIBRARIES} "secur32.dll" @@ -39,7 +34,7 @@ ENDIF( WIN32 ) target_link_libraries( sip_jabber ${QT_LIBRARIES} - ${GLOOX_LIBS} + ${GLOOX_LIBRARIES} ${OS_SPECIFIC_LINK_LIBRARIES} )