From 1c2e752f3ce87055d52289c5713aad0a06447c2f Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Wed, 5 Mar 2014 19:57:59 +0200 Subject: [PATCH] Integrated QXmpp in the build system. --- CMakeLists.txt | 6 ++++++ cmake/modules/FindQxmpp.cmake | 38 +++++++++++++++++++++++++++++++++ interface/CMakeLists.txt | 4 ++++ libraries/shared/CMakeLists.txt | 5 ++--- 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 cmake/modules/FindQxmpp.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 33589ddb57..b3e1af23e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,12 @@ if (APPLE) endif (DARWIN_VERSION GREATER 12) endif (APPLE) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/") + +find_package(qxmpp REQUIRED) +add_definitions(-DQXMPP_STATIC) +include_directories(SYSTEM ${QXMPP_INCLUDE_DIR}) + # targets not supported on windows if (NOT WIN32) add_subdirectory(animation-server) diff --git a/cmake/modules/FindQxmpp.cmake b/cmake/modules/FindQxmpp.cmake new file mode 100644 index 0000000000..f50212d63f --- /dev/null +++ b/cmake/modules/FindQxmpp.cmake @@ -0,0 +1,38 @@ +# Try to find the qxmpp library +# +# You can provide a QXMPP_ROOT_DIR which contains lib and include directories +# +# Once done this will define +# +# QXMPP_FOUND - system found qxmpp +# QXMPP_INCLUDE_DIRS - the qxmpp include directory +# QXMPP_LIBRARIES - Link this to use qxmpp +# +# Created on 3/10/2014 by Stephen Birarda +# Copyright (c) 2014 High Fidelity +# + +if (QXMPP_LIBRARIES AND QXMPP_INCLUDE_DIRS) + # in cache already + set(QXMPP_FOUND TRUE) +else () + + set(QXMPP_SEARCH_DIRS "${QXMPP_ROOT_DIR}" "$ENV{HIFI_LIB_DIR}/qxmpp") + + find_path(QXMPP_INCLUDE_DIR QXmppClient.h PATH_SUFFIXES include/qxmpp HINTS ${QXMPP_SEARCH_DIRS}) + + find_library(QXMPP_LIBRARY NAMES qxmpp qxmpp0 PATH_SUFFIXES lib HINTS ${QXMPP_SEARCH_DIRS}) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(QXMPP DEFAULT_MSG QXMPP_INCLUDE_DIR QXMPP_LIBRARY) + + if (QXMPP_FOUND) + if (NOT QXMPP_FIND_QUIETLY) + message(STATUS "Found qxmpp: ${QXMPP_LIBRARY}") + endif (NOT QXMPP_FIND_QUIETLY) + else () + if (QXMPP_FIND_REQUIRED) + message(FATAL_ERROR "Could not find qxmpp") + endif (SIXENSE_FIND_REQUIRED) + endif () +endif () \ No newline at end of file diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index f73cf0fd64..9f176d1ee8 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -65,6 +65,10 @@ endforeach(EXTERNAL_SOURCE_SUBDIR) find_package(Qt5 COMPONENTS Core Gui Multimedia Network OpenGL Script Svg WebKit WebKitWidgets Xml UiTools) +find_package(Qxmpp REQUIRED) +add_definitions(-DQXMPP_STATIC) +include_directories(SYSTEM ${QXMPP_INCLUDE_DIR}) + # grab the ui files in resources/ui file (GLOB_RECURSE QT_UI_FILES ui/*.ui) # have qt5 wrap them and generate the appropriate header files diff --git a/libraries/shared/CMakeLists.txt b/libraries/shared/CMakeLists.txt index 658542637f..40473c924a 100644 --- a/libraries/shared/CMakeLists.txt +++ b/libraries/shared/CMakeLists.txt @@ -10,7 +10,7 @@ set(MACRO_DIR "${ROOT_DIR}/cmake/macros") set(TARGET_NAME shared) project(${TARGET_NAME}) -find_package(Qt5 COMPONENTS Network Widgets) +find_package(Qt5 COMPONENTS Network Widgets Xml) include(${MACRO_DIR}/SetupHifiLibrary.cmake) setup_hifi_library(${TARGET_NAME}) @@ -19,7 +19,6 @@ setup_hifi_library(${TARGET_NAME}) include(${MACRO_DIR}/IncludeGLM.cmake) include_glm(${TARGET_NAME} "${ROOT_DIR}") - set(EXTERNAL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external") if (WIN32) @@ -33,4 +32,4 @@ if (UNIX AND NOT APPLE) target_link_libraries(${TARGET_NAME} "${CMAKE_THREAD_LIBS_INIT}") endif (UNIX AND NOT APPLE) -target_link_libraries(${TARGET_NAME} Qt5::Network Qt5::Widgets) \ No newline at end of file +target_link_libraries(${TARGET_NAME} Qt5::Network Qt5::Widgets Qt5::Xml "${QXMPP_LIBRARY}")