[CMake] the remaining problems with compiling KDE with cmake

Alexander Neundorf a.neundorf-work at gmx.net
Mon Jun 13 03:38:10 EDT 2005


Hi,  
  
I'm still trying to compile KDE with cmake (I'm quite far in the  
meantime, kdebase compiles almost without manually tweaking using the  
CMakeLists.txt files automatically translated from Makefile.ams ).  
  
The biggest problem I still have is that in KDE relatively often there is  
an application kfoo and a library libkfoo.so, which results in cmake in  
the same name for the target (kdevelop + libkdevelop.so, libkasbar.so +  
kasbar, kdesu + libkdesu, almost: konqueror + libkonq.so, kicker +  
libkickermain.so, and probably more).  
  
I see two ways around it:  
1) implement something in cmake so that the executable is built e.g. as  
"kdevelop_app", but when installing it is installed as "kdevelop" (e.g.  
SET_TARGET_PROPERTY(kdevelop_app PROPERTIES INSTALL_NAME kdevelop)  
  
2 and much better) enable cmake to deal correctly with targets with the  
same name if they are of different type (i.e. once ADD_EXECUTABLE and  
once ADD_LIBRARY). This would be much better but I know it would probably  
also mean a lot of work.  
  
Beside this problem, there is still the issue with the libtool  
convenience libraries, which I handle currently manually using a macro.   
Works, but not very nice:  
KDE_TARGET_LINK_CONV_LIBRARIES(kfoo some_static_lib.a)  
which gets translated to a special linker argument.  
There is a cmake wishlist item/bug report about this issue, and a  
proposed solution was to be able to extract the objects of a given static  
library and link them all together in the resultin shared library. Is  
this already possible ?  
  
How hard would it be to add something like  
ADD_LIBRARY(foo CONVENIENCE foo.c bar.c)   
and when linking to this lib use the appropriate flags ?  
See here the macro, in the comment you can see the same flags as used by  
libtool: 

http://websvn.kde.org/trunk/KDE/kdevelop/cmake/KDEMacros.cmake?rev=409203&view=auto
 
  
Another idea would be SET_TARGET_PROPERTIES(foo PROPERTIES CONVENIENCE  
TRUE) or something.  
 
Bye 
Alex 
 

-- 
Geschenkt: 3 Monate GMX ProMail gratis + 3 Ausgaben stern gratis
++ Jetzt anmelden & testen ++ http://www.gmx.net/de/go/promail ++


More information about the CMake mailing list