From kde-core-devel Wed Jan 25 22:49:38 2006 From: Mickael Marchand Date: Wed, 25 Jan 2006 22:49:38 +0000 To: kde-core-devel Subject: Re: invitation: try compiling kdelibs using cmake Message-Id: <43D80082.4080106 () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=113822939519333 Hi Alex, I just did a quick try :) I have kde4 in /opt/kde4 and cmake compiled from cvs in there Qt4 (debug build) is in /opt/qt4 I've created a b2 directory in my kdelibs tree (build dir), and ran cmake ../ it did all the checks pretty fine apparently but it does not seem to find my Qt libs ... > CMake Error: This project requires some variables to be set, > and cmake can not find them. > Please set the following variables: > QT_QT3SUPPORT_LIBRARY (ADVANCED) > QT_QTCORE_LIBRARY (ADVANCED) > QT_QTGUI_LIBRARY (ADVANCED) > QT_QTXML_LIBRARY (ADVANCED) mikmak@alhya:~/src/kde/trunk/kdelibs/b2$ echo $QTDIR /opt/qt4 does it require non-debug qt build maybe ? Cheers, Mik Alexander Neundorf wrote: > Hi, > > as many of you probably know during the last two weeks I was busy with making > trunk kdelibs build with cmake (http://www.cmake.org). > > I think now I have reached a state were I can invite interested people to try > compiling kdelibs with cmake. > > I compiled kdelibs successfully on Slackware 9.1 (gcc 3.2.3) and FreeBSD 5.4 > (gcc 3.4.2) , Bill Hoffman was able to compile it on Debian (gcc 4.x). > > kxmlcore and the directories which depend on it (kjs, khtml, kate) are still > excluded from the build, neither gcc 3.2.3 on my slackware box nor gcc > *3.4.2* on the FreeBSD box were able to compile it > (http://lists.kde.org/?l=kfm-devel&m=113796106221351&w=2). > > Right now everything compiles and links and correct install rules are created. > If the option "KDE4_BUILD_TESTS" is enabled, also most of the check_PROGRAMS > are created (not all, I didn't understand all the custom rules yet). > > cmake supports Makefiles for basically every UNIX including Mac OS X. It also > support Makefiles for cygwin, mingw and cl, and it support project files for > XCode and MSVC 6,7 and 8. > > In order to compile kdelibs using cmake, you need cmake from current cmake > cvs: > > $ cvs -d :pserver:anonymous at www.cmake.org:/cvsroot/CMake login > (respond with password cmake) > Follow this command by checking out the source code: > $ cvs -d :pserver:anonymous at www.cmake.org:/cvsroot/CMake co CMake > (as usual: configure, make, make install) > > Then build cmake: ./configure; make; make install > > Then enter the kdelibs directory, and enter "cmake ." > Then the configure checks will be executed. If something isn't found, execute > "ccmake ." and set the directories manually. > If Qt 4 wasn't found, either set it manually or set the QTDIR environment > variable. > > You can find all configure checks in kdelibs/ConfigureChecks.cmake. > > The check_XXX() functions come from the CheckXXX.cmake files located in > kdelibs/cmake/modules/ and from the cmake system module directory, > usually /usr/local/share/CMake/Modules/. So if one of these checks go wrong, > look in these files to see what they are doing. > To see what exactly went wrong, have a look at > kdelibs/CMakeFiles/CMakeError.log > > In ConfigureChecks.cmake there are also some checks like > find_package(Foo REQUIRED) > These commands look for a file named "FindFoo.cmake", located either in > kdelibs/cmake/modules/ or the system cmake module directory (as above). > If something isn't found and you know it exists on your system, have a look at > the FindFoo.cmake file. > To understand the commands used there, either read the cmake man page or read > the documentation online: http://www.cmake.org/HTML/Documentation.html (*very > recommded*). also the cmake Wiki: http://www.cmake.org/Wiki/CMake . > > Ok, assume this step succeeded, simply run make. Chances are not too bad it > will compile. > > If not, the reason is usually a missing include directory or a missing link > library. > > The build is specified in the files named CMakeLists.txt. > Important variables are CMAKE_SOURCE_DIR, CMAKE_BINARY_DIR, > CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR, for more information > see http://www.cmake.org/Wiki/CMake_Useful_Variables . > Include directories are added using the include_directories() command. > Additional libraries is linked to using the target_link_libraries() command. > > If you try to build it on Mac OS X or under Windows, you will immediately get > an error message (see kdelibs/cmake/modules/FindKDE4.cmake . To get it > working, remove the MESSAGE(FATAL_ERROR ...) from this file and see how far > you get. Probably some of the system checks and FindFoo.cmake files have to > be adjusted, compiler flags etc. > > if you need to write additional FindFoo.cmake scripts, you can use the > kdelibs/cmake/generate_findpackage_file script, written in Ruby. It generates > simple generic cmake scripts which follow the cmake style. > > If you have questions, please ask on the kde-buildsystem@kde.org mailing list, > there are also two of the cmake developers subscribed. They want cmake to > become the buildsystem for KDE 4. > > Have fun > Alex