This forum has been archived. All content is frozen. Please use KDE Discuss instead.

QXmlSchema and CMakeLists.txt

Tags: None
(comma "," separated)
framas
Registered Member
Posts
5
Karma
0
OS

QXmlSchema and CMakeLists.txt

Thu Jan 21, 2010 2:33 pm
Hi folks,

I want to use the QXmlSchema class to validate some xml files against a xml schema file in a kde cmake project.
Currently I run into linker errors (undefined references to QXmlSchema) when I build it.

On google I found I that I had to add ${QT_QTXML_LIBRARY} to target_link_libraries but this does not solve my problem.

Anyone hast got an advice for me?

Cheers Frank.
pinotree
KDE Developer
Posts
222
Karma
7
OS

Re: QXmlSchema and CMakeLists.txt

Thu Jan 21, 2010 2:46 pm
The QXmlSchema class is part of the QtXmlPatterns library (not QtXml); thus, you need to link to it using the variable ${QT_QTXMLPATTERNS_LIBRARY}.

In general, the naming for the CMake variables for Qt4 libraries is quite simple: all of them follow the general pattern ${QT_libraryname_LIBRARY}, where libraryname is the uppercase name of the library.
For example: QtCore -> ${QT_QTCORE_LIBRARY}, QtXml -> ${QT_QTXML_LIBRARY}, QtScriptTools -> ${QT_QTSCRIPTTOOLS_LIBRARY}, and so on.

Similar scheme for the KDE4 libraries, using ${KDE4_libraryname_LIBRARY} for indicating the library itself and ${KDE4_libraryname_LIBRARIES} for the library and all the required libraries needed when using it (eg using kdeui you most probably will use kdecore as well).
For example: kdeui -> ${KDE4_KDEUI_LIBRARY}, kio -> ${KDE4_KIO_LIBRARY}, and so no.


Pino Toscano
framas
Registered Member
Posts
5
Karma
0
OS
Hi Pino,

thank you, it's working now.

Frank


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]