FindQCA2.cmake

Bo Ørsted Andresen bo.andresen at zlin.dk
Sun Nov 16 01:15:24 CET 2008


On Saturday 15 November 2008 07:52:25 Andreas Pakulat wrote:
> > <@zlin> ok, the problem is there is a name space conflict
> > <@zlin> pkg_check_modules(QCA2 qca2) marks QCA2_LIBRARIES as INTERNAL
> > and assigns a list of libraries to it
> > <@zlin> FIND_LIBRARY(QCA2_LIBRARIES NAMES qca ...) was supposed to
> > mark it as a FILEPATH and assign a path to it
> > <@zlin> but apparently fails because it already exists with a different
> > type <@zlin> one solution is to change QCA2 in the pkg_check_modules
> > call. another is to use a different variable name in FIND_LIBRARY and in
> > ./ktorrent/libbtcore/CMakeLists.txt
> > <@zlin> someone who isn't me should take this issue upstream
>
> Why is it a problem that find_library "doesn't do anything"?
> pkg_check_modules tries to find the libraries and if its successful those
> libraries should be used. If not there's a fallback using find_library.
>
> So whats the exact error message you get? Also post your CMakeCache.txt and
> the relevant CMakeLists.txt (or at least provide a websvn link).

The output from find_library is the full path to the libqca library. This is
what the modules using FindQCA2.cmake expect QCA2_LIBRARIES to contain. One
example of a consumer is Okular from kdegraphics:

-- checking for module 'qca2'
--   found qca2, version 2.0.1
-- Found QCA2: qca;QtCore;z;m;gthread-2.0;rt;glib-2.0;pthread;dl
[...]
Scanning dependencies of target okularGenerator_fb
[ 86%] Building CXX object okular/generators/fictionbook/CMakeFiles/okularGenerator_fb.dir/okularGenerator_fb_automoc.o
[ 87%] Building CXX object okular/generators/fictionbook/CMakeFiles/okularGenerator_fb.dir/converter.o
Linking CXX shared module ../../../lib/okularGenerator_ooo.so
[ 87%] Building CXX object okular/generators/fictionbook/CMakeFiles/okularGenerator_fb.dir/document.o
/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lqca
collect2: ld returned 1 exit status
make[2]: *** [lib/okularGenerator_ooo.so] Error 1
make[1]: *** [okular/generators/ooo/CMakeFiles/okularGenerator_ooo.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 88%] /var/tmp/paludis/kde-base-okular-scm/work/okular/okular/generators/fictionbook/document.cpp: In member function 'bool FictionBook::Document::open()':
/var/tmp/paludis/kde-base-okular-scm/work/okular/okular/generators/fictionbook/document.cpp:26: warning: 'device' may be used uninitialized in this function
Building CXX object okular/generators/fictionbook/CMakeFiles/okularGenerator_fb.dir/generator_fb.o
Linking CXX shared module ../../../lib/okularGenerator_fb.so
[ 88%] Built target okularGenerator_fb
make: *** [all] Error 2

-----

CMakeCache.txt:QCA2_LIBRARIES-ADVANCED:INTERNAL=1
CMakeCache.txt:QCA2_LIBRARIES:INTERNAL=qca;QtCore;z;m;gthread-2.0;rt;glib-2.0;pthread;dl

After fixing this bug it compiles and you get:

CMakeCache.txt:QCA2_LIBRARIES:FILEPATH=/usr/lib/qca2/libqca.so
CMakeCache.txt:QCA2_LIBRARIES-ADVANCED:INTERNAL=1

-- 
Bo Andresen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20081116/434e5c1f/attachment.sig 


More information about the Kde-buildsystem mailing list