CMake: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(→‎Converters from other buildsystems to CMake: Added reference to gcc-xml and the excellent CMake scripts it uses to replace autoconf - also added sub-subsections)
Line 53: Line 53:
All converters listed here are not "complete", i.e. the generated CMake files are not 100% finished, in all cases some work is left for the developer.
All converters listed here are not "complete", i.e. the generated CMake files are not 100% finished, in all cases some work is left for the developer.


* [http://websvn.kde.org/trunk/KDE/kdesdk/cmake/scripts/ am2cmake (requires Ruby) ] Converts automake/autotools/libtool based projects to CMake, spezialiced in converting from KDE 3 to KDE 4, should also work for others. This one has been used for converting the KDE buildsystem to CMake.
====automake/autotools/autoconf====
* [http://websvn.kde.org/trunk/KDE/kdesdk/cmake/scripts/ am2cmake (requires Ruby) ] Converts automake/autotools/libtool based projects to CMake, specialized in converting from KDE 3 to KDE 4, should also work for others. This one has been used for converting the KDE buildsystem to CMake.


* [http://emanuelgreisen.dk/stuff/kdevelop_am2cmake.php.tgz Alternative Automake2CMake (requires PHP)] Converts KDevelop projects that use automake to CMake.
* [http://emanuelgreisen.dk/stuff/kdevelop_am2cmake.php.tgz Alternative Automake2CMake (requires PHP)] Converts KDevelop projects that use automake to CMake.


=====autoconf=====
When converting from autoconf, the generation of "config.h" files can be complex. You may wish to examine the CMake scripts within the gcc-xml project at [http://www.gccxml.org/HTML/Index.html gcc-xml (XML output of gcc's internal representation)]. The project builds a modified gcc compiler using CMake. This is an impressive feat of autoconf conversion.
For example, the HAVE_THIS/HAVE_THAT defines used within autoconf projects can be overwhelming when converting a large project.  Below is a snippet from the "config.h.in" file within gcc-xml:
<tt>
: /* Define to 1 if you have the `bcopy' function. */
: #cmakedefine HAVE_BCOPY @HAVE_BCOPY@
: /* Define to 1 if you have the `bsearch' function. */
: #cmakedefine HAVE_BSEARCH @HAVE_BSEARCH@
: /* Define to 1 if you have the `bzero' function. */
: #cmakedefine HAVE_BZERO @HAVE_BZERO@
</tt>
While not a drop-in tool, their scripts are an excellent starting point.
====qmake====
* [[CMake:ConvertFromQmake | qmake converter (requires Ruby)]] Converts projects that use Qt's qmake.
* [[CMake:ConvertFromQmake | qmake converter (requires Ruby)]] Converts projects that use Qt's qmake.


====KDE====
* [http://websvn.kde.org/trunk/KDE/kdesdk/cmake/scripts/ gencmake (requires Ruby) ] Creates basic CMakeLists.txt files from looking at the existing files.
* [http://websvn.kde.org/trunk/KDE/kdesdk/cmake/scripts/ gencmake (requires Ruby) ] Creates basic CMakeLists.txt files from looking at the existing files.


====Visual Studio====
* [http://www.eskilson.se/vcproj2cmake.rb vcproj2cmake.rb (requires Ruby)] Creates CMakeLists.txt files by extracting info from Visual Studio project files.
* [http://www.eskilson.se/vcproj2cmake.rb vcproj2cmake.rb (requires Ruby)] Creates CMakeLists.txt files by extracting info from Visual Studio project files.



Revision as of 10:24, 11 March 2008

CMakeBanner.jpg

Welcome to CMake, the cross-platform, open-source make system. CMake is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice. CMake is quite sophisticated: it is possible to support complex environments requiring system configuration, pre-processor generation, code generation, and template instantiation.

You will find here not only documentation for CMake, but also for CPack and CTest.

CMake

Primary Resources - Look here first!

Development Topics

Tutorials

Basic Introductions

Specific Topics

  • Qt with CMake
    Explains how to use CMake to build software with Qt4, Qt3 and KDE3.

Converters from other buildsystems to CMake

All converters listed here are not "complete", i.e. the generated CMake files are not 100% finished, in all cases some work is left for the developer.

automake/autotools/autoconf

  • am2cmake (requires Ruby) Converts automake/autotools/libtool based projects to CMake, specialized in converting from KDE 3 to KDE 4, should also work for others. This one has been used for converting the KDE buildsystem to CMake.
autoconf

When converting from autoconf, the generation of "config.h" files can be complex. You may wish to examine the CMake scripts within the gcc-xml project at gcc-xml (XML output of gcc's internal representation). The project builds a modified gcc compiler using CMake. This is an impressive feat of autoconf conversion.

For example, the HAVE_THIS/HAVE_THAT defines used within autoconf projects can be overwhelming when converting a large project. Below is a snippet from the "config.h.in" file within gcc-xml:

/* Define to 1 if you have the `bcopy' function. */
#cmakedefine HAVE_BCOPY @HAVE_BCOPY@
/* Define to 1 if you have the `bsearch' function. */
#cmakedefine HAVE_BSEARCH @HAVE_BSEARCH@
/* Define to 1 if you have the `bzero' function. */
#cmakedefine HAVE_BZERO @HAVE_BZERO@

While not a drop-in tool, their scripts are an excellent starting point.

qmake

KDE

Visual Studio

Success Stories

More Topics

CTest

Tutorials

  • Testing With CTest
    Introduces to testing with CTest, submitting dashboards, and using CMake to add tests to the test system.
  • CTest Scripting
    Describes the scripting with CTest which can significantly simplify and automate testing and submitting dashboards.

More Information


CPack

Tutorials

More Information

CDash



CMake: [Welcome | Site Map]