Am Donnerstag, 7. November 2013 um 19:20:02, schrieb Kornel Benko 
<kor...@lyx.org>
> Am Mittwoch, 6. November 2013 um 23:42:33, schrieb Tommaso Cucinotta 
> <tomm...@lyx.org>
> > On 04/11/13 10:58, Jean-Marc Lasgouttes wrote:
> > > Have a look at what is done in config/spell.m4 for the different spell 
> > > checkers, There are two ingredients:
> > > - a USE_xxx #define, that can be used in the code to do conditional 
> > > compilation
> > > - a USE_xxx automake conditional that is used to decide which pieces of 
> > > code shall be compiled.
> > 
> > Done, thanks! If you have a look at my personal development playground
> > 
> >   git clone g...@git.lyx.org:developers/tommaso/lyx
> >   git checkout features/chat
> > 
> > you will find the patch adapted according to what you suggest (didn't try 
> > to compile without the libraries on my system, but there should not be 
> > surprises, as I copied the spell-related stuff).
> > 
> > For your convenience, I'm attaching only the part of the patch relative to 
> > the autoconf-iguration.
> > 
> >     T.
> 
> I get errors while compiling:
> ...
> cd /usr/BUILD/BuildLyxGitChat/src/frontends/qt4 && /usr/bin/c++   
> -DLYX_BUILD_QT4_FRONTEND -DQT_GENUINE_STR -Wall -Wunused-parameter 
> -std=gnu++0x -fno-strict-aliasing  -Wall -Wunused-parameter -std=gnu++0x 
> -fno-strict-aliasing -O0 -g3 -D_DEBUG -I/usr/BUILD/BuildLyxGitChat 
> -I/mnt/usr6/src/lyx/lyx/src -I/usr/include/enchant 
> -I/mnt/usr6/src/lyx/lyx/boost -I/mnt/usr6/src/lyx/lyx/src/frontends 
> -I/mnt/usr6/src/lyx/lyx/src/frontends/qt4 -I/usr/include/qt4 
> -I/usr/include/qt4/Qt -I/usr/share/qt4/mkspecs/default 
> -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui 
> -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/QtDesigner 
> -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtOpenGL 
> -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSvg 
> -I/usr/include/qt4/QtUiTools -I/usr/include/qt4/QtTest 
> -I/usr/BUILD/BuildLyxGitChat/src/frontends/qt4    
> -DBOOST_USER_CONFIG="<config.h>" -o 
> CMakeFiles/frontend_qt4.dir/GuiChatMessenger.cpp.o -c 
> /mnt/usr6/src/lyx/lyx/src/frontends/qt4/GuiChatMessenger.cpp
> In file included from 
> /mnt/usr6/src/lyx/lyx/src/frontends/qt4/GuiChatMessenger.cpp:4:0:
> /mnt/usr6/src/lyx/lyx/src/frontends/qt4/GuiBuddies.h:52:35: error: 
> ‘QXmppClient::State’ has not been declared
> /mnt/usr6/src/lyx/lyx/src/frontends/qt4/GuiChatMessenger.cpp:78:33: error: 
> ‘AvailableStatusType’ is not a member of ‘QXmppPresence’
> /mnt/usr6/src/lyx/lyx/src/frontends/qt4/GuiChatMessenger.cpp:78:71: error: 
> expected ‘,’ or ‘;’ before ‘{’ token
> In file included from 
> /mnt/usr6/src/lyx/lyx/src/frontends/qt4/GuiChatMessenger.cpp:101:0:
> /usr/BUILD/BuildLyxGitChat/src/frontends/qt4/moc_GuiChatMessenger.cpp:93:1: 
> error: expected ‘}’ at end of input
> /usr/BUILD/BuildLyxGitChat/src/frontends/qt4/moc_GuiChatMessenger.cpp:93:1: 
> error: expected ‘}’ at end of input
> make[2]: *** 
> [src/frontends/qt4/CMakeFiles/frontend_qt4.dir/GuiChatMessenger.cpp.o] Error 1
> make[2]: Leaving directory `/usr/BUILD/BuildLyxGitChat'
> make[1]: *** [src/frontends/qt4/CMakeFiles/frontend_qt4.dir/all] Error 2
> make[1]: Leaving directory `/usr/BUILD/BuildLyxGitChat'
> make: *** [all] Error 2
> ...
> 
> The version of libqxmpp-dev package is 0.3.0-1ubuntu1. Do I need something 
> newer?
> 
>       Kornel

Never mind.

1.)Got and compiled sources with:
        #git clone https://code.google.com/p/qxmpp/
        #cd qxmpp
        #qmake
        #make
        #sudo make install

2.) Attached are
        a.) Patch for CmakeLists.txt, src/CMakeLists.txt
        b.) New module in development/cmake/modules
                FindLibQxmpp.cmake

        Kornel
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ccb4a6c..e00485b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -515,6 +515,9 @@ if(LYX_HUNSPELL)
 	include_directories(${HUNSPELL_INCLUDE_DIR})
 endif()
 
+find_package(LibQxmpp REQUIRED)
+include_directories(${LIBQXMPP_INCLUDEDIR})
+
 if(LYX_NLS)
 	FIND_PROGRAM(LYX_PYTHON_EXECUTABLE python2 python HINTS ${GNUWIN32_DIR}/python)
 	find_package(LyXGettext)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5203d45..b92dd82 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -136,7 +136,8 @@ target_link_libraries(${_lyx}
 	support
 	${ICONV_LIBRARY}
 	${QT_QTMAIN_LIBRARY}
-	${vld_dll})
+	${vld_dll}
+	${LIBQXMPP_LIBRARIES})
 
 if(HUNSPELL_FOUND)
 	target_link_libraries(${_lyx} ${HUNSPELL_LIBRARY})
diff --git a/src/frontends/qt4/GuiBuddies.h b/src/frontends/qt4/GuiBuddies.h
index d85f131..a590257 100644
--- a/src/frontends/qt4/GuiBuddies.h
+++ b/src/frontends/qt4/GuiBuddies.h
@@ -32,6 +32,7 @@
 #include <string>
 
 #include <qxmpp/QXmppClient.h>
+#include <qxmpp/QXmppMessage.h>
 
 namespace lyx {
 namespace frontend {
# FindLibQxmpp
# ---------
#
# Try to find libqxmpp library
#
# Once done this will define
#
# ::
#
#  LIBQXMPP_FOUND
#  LIBQXMPP_INCLUDE_DIR
#

find_path(LIBQXMPP_INCLUDEDIR "qxmpp/QXmppSocks.h")
find_library(LIBQXMPP_LIBRARIES NAMES qxmpp)

# use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
  pkg_check_modules(PC_LIBQXMPP QUIET "qxmpp")
endif()

if(PC_LIBQXMPP_VERSION)
  set(LIBQXMPP_VERSION_STRING "${PC_LIBQXMPP_VERSION}")
endif()

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibQxmpp
  REQUIRED_VARS LIBQXMPP_LIBRARIES
  LIBQXMPP_INCLUDEDIR LIBQXMPP_VERSION_STRING)

mark_as_advanced(LIBQXMPP_LIBRARIES
  LIBQXMPP_INCLUDEDIR)

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to