Split building

Piotr Jaroszyński p.jaroszynski at gmail.com
Mon Jan 7 18:41:07 CET 2008


Hello,

while preparing the 4.0 release in Gentoo we have hit a problem with split 
packages (each app/lib in a separate package, like konqueror, libkonq, kdm 
etc.). To present the problem I will use a concrete example of kdepasswd. In 
order to build it we only unpack apps/kdepasswd (and mandatory files from 
parent dirs like CMakelist.txt from the topdir) from kdebase tarball. 

Everything works fine until it comes to linking some libraries, for example:

Linking CXX shared module ../../../lib/kcm_useraccount.so
CMakeFiles/kcm_useraccount.dir/main.o: In function 
`KCMUserAccount::~KCMUserAccount()':
main.cpp:(.text+0xf4): undefined reference to 
`KEMailSettings::~KEMailSettings()'
main.cpp:(.text+0x105): undefined reference to `QPixmap::~QPixmap()'
(lots)

David Faure helped me to track down this problem to CMake being unable to 
expand targets it normally knows when building everything together, i.e.:

apps/kdepasswd/kcm/CMakeLists.txt:
target_link_libraries(kcm_useraccount konq ${QT_QTXML_LIBRARY} 
${KDE4_KPARTS_LIBS} ${KDE4_KDESU_LIBS})

CMake cannot expand konq as it doesn't know it's a target in another subtree:

apps/lib/konq/CMakeLists.txt:
target_link_libraries(konq ${QT_QTXML_LIBRARY} ${KDE4_KPARTS_LIBS})

Can you think of any nice solution to this problem? I have only thought of 
keeping a map of deps like konq -> ${QT_QTXML_LIBRARY} ${KDE4_KPARTS_LIBS} 
and sed'ing all the CMakelists, but tbh I don't know CMake too well.

-- 
Best Regards,
Piotr Jaroszyński


More information about the Kde-buildsystem mailing list