compiling kdevelop using cmake

Alexander Neundorf neundorf at kde.org
Tue May 17 21:50:06 UTC 2005


Hi,

I think right now the complete (almost) kdevelop compiles and links using 
cmake (cvs).

It does:
-uses only cmake, no autoconf, no automake, no autoheader, no libtool, no m4, 
no perl, no python, no shell, etc.
-build and install the shared libs
-build and install the plugins and creates the .la files (e.g. 
kdevelop/parts/abbrev/CMakeLists.txt) 
---------8<-------------8<------------8<------------------------------
#the source files for this part
SET(kdevabbrev_PART_SRCS
abbrevpart.cpp abbrevconfigwidget.cpp addtemplatedlg.cpp )

#the ui files for this part
SET( kdevabbrev_UI
abbrevconfigwidgetbase.ui addtemplatedlgbase.ui )

#automatically generated the rules for the moc files for the sources
KDE_AUTOMOC(${kdevabbrev_PART_SRCS})

#add the ui files to the project
KDE_ADD_UI_FILES(kdevabbrev_PART_SRCS ${kdevabbrev_UI} )

#create a shared library/module/plugin
ADD_LIBRARY(kdevabbrev MODULE ${kdevabbrev_PART_SRCS})

#link it to some kde libs
TARGET_LINK_LIBRARIES(kdevabbrev ${KDEV_PART_LIBS})

#create the libtool la file for this plugin
KDE_CREATE_LIBTOOL_FILE(kdevabbrev)

#install rules, relative to CMAKE_INSTALL_PREFIX
INSTALL_TARGETS(/lib/kde3 kdevabbrev)
INSTALL_FILES(/share/apps/kdevabbrev FILES kdevabbrev.rc)
INSTALL_FILES(/share/services FILES kdevabbrev.desktop)
INSTALL_FILES(/share/apps/kdevabbrev/sources FILES qt_classes cpp_keywords)

----------8<-------------8<------------8<------------------------------

-build and install the binaries
-you can select the supported languages using ccmake, implemented using the 
OPTION() command (kdevelop/languages/CMakeLists.txt)
-it does some "configure" checks for libz, libpng and dlfcn.h 
(kdevelop/CheckSystem.cmake)

Remaining issues:

-libtool convenience libs: currently done via a (slightly hackish) 
KDE_TARGET_LINK_CONV_LIBS() macro. Maybe these could get rid of completely 
and simply compiling the files directly where they are needed instead of 
creating a static lib ?

-still quite some manual work for the rest of the configure checks is needed 
and even more install rules (icons etc.)

-if required several cmake commands could be compiled into KDE specific 
macros, so that less commands would be required per CMakeLists.txt (not sure 
this would be an improvement, I usually prefer the "less magic, more obvious" 
style).

-untested on on *BSD, Mac OS X, cygwin, Windows

-the kdevelop-specific problem of two targets with the same name: 
(lib)kdevelop(.so) and kdevelop

What do you think ?

Bye
Alex
-- 
Work: alexander.neundorf at jenoptik.com - http://www.jenoptik-los.de
Home: neundorf at kde.org                - http://www.kde.org
      alex at neundorf.net               - http://www.neundorf.net




More information about the KDevelop-devel mailing list