(First draft) |
(document most of the macros from FindKDE4Internal.cmake) |
||
| Line 63: | Line 63: | ||
Lots of useful macros: | Lots of useful macros: | ||
| − | * KDE4_ADD_UI_FILES | + | |
| − | * KDE4_ADD_UI3_FILES | + | * KDE4_ADD_UI_FILES (SRCS_VAR file1.ui ... fileN.ui) |
| − | * KDE4_ADD_KCFG_FILES | + | |
| + | Use this to add Qt designer ui files to your application/library. | ||
| + | |||
| + | * KDE4_ADD_UI3_FILES (SRCS_VAR file1.ui ... fileN.ui) | ||
| + | |||
| + | Use this to add Qt designer ui files from Qt version 3 to your application/library. | ||
| + | |||
| + | * KDE4_ADD_KCFG_FILES (SRCS_VAR [GENERATE_MOC] file1.kcfgc ... fileN.kcfgc) | ||
| + | |||
| + | Use this to add KDE config compiler files to your application/library. | ||
| + | Use optional GENERATE_MOC to generate moc if you use signals in your kcfg files. | ||
| + | |||
| + | * KDE4_ADD_WIDGET_FILES (SRCS_VAR file1.widgets ... fileN.widgets) | ||
| + | |||
| + | Use this to add widget description files for the makekdewidgets code generator for Qt Designer plugins. | ||
| + | |||
| + | * KDE4_ADD_PLUGIN ( name [WITH_PREFIX] file1 ... fileN ) | ||
| + | |||
| + | Create a KDE plugin (KPart, kioslave, etc.) from the given source files. | ||
| + | It supports KDE4_ENABLE_FINAL. | ||
| + | If WITH_PREFIX is given, the resulting plugin will have the prefix "lib", otherwise it won't. | ||
| + | It creates and installs an appropriate libtool la-file. | ||
| + | |||
| + | * KDE4_ADD_KDEINIT_EXECUTABLE (name [NOGUI] [RUN_UNINSTALLED] file1 ... fileN) | ||
| + | |||
| + | Create a KDE application in the form of a module loadable via kdeinit. | ||
| + | A library named kdeinit_<name> will be created and a small executable which links to it. | ||
| + | It supports KDE4_ENABLE_FINAL | ||
| + | If the executable has to be run from the buildtree (e.g. unit tests and code generators used later on when compiling), set the option RUN_UNINSTALLED. | ||
| + | If the executable doesn't have a GUI, use the option NOGUI. By default on OS X application bundles are created, with the NOGUI option no bundles but simple executables are created. Currently it doesn't have any effect on other platforms. | ||
| + | |||
| + | * KDE4_ADD_EXECUTABLE (name [NOGUI] [RUN_UNINSTALLED] file1 ... fileN) | ||
| + | |||
| + | Equivalent to ADD_EXECUTABLE(), but additionally adds some more features: | ||
| + | -support for KDE4_ENABLE_FINAL | ||
| + | -support for automoc | ||
| + | -automatic RPATH handling | ||
| + | If the executable has to be run from the buildtree (e.g. unit tests and code generators used later on when compiling), set the option RUN_UNINSTALLED. | ||
| + | If the executable doesn't have a GUI, use the option NOGUI. By default on OS X application bundles are created, with the NOGUI option no bundles but simple executablesare created. Currently it doesn't have any effect on other platforms. | ||
| + | |||
| + | * KDE4_ADD_LIBRARY (name [STATIC | SHARED | MODULE ] file1 ... fileN) | ||
| + | |||
| + | Equivalent to ADD_LIBRARY(), but additionally it supports KDE4_ENABLE_FINAL and under Windows it adds a -DMAKE_<name>_LIB definition to the compilation. | ||
| + | |||
| + | * KDE4_ADD_UNIT_TEST (testname [TESTNAME targetname] file1 ... fileN) | ||
| + | |||
| + | add a unit test, which is executed when running make test | ||
| + | it will be built with RPATH poiting to the build dir | ||
| + | The targets are always created, but only built for the "all" target if the option KDE4_BUILD_TESTS is enabled. Otherwise the rules for the target are created but not built by default. You can build them by manually building the target. | ||
| + | The name of the target can be specified using TESTNAME <targetname>, if it is not given | ||
| + | the macro will default to the <testname> | ||
| + | |||
| + | * KDE4_ADD_TEST_EXECUTABLE (name file1 ... fileN) | ||
| + | |||
| + | add an test executable | ||
| + | it will be built with RPATH poiting to the build dir | ||
| + | The targets are always created, but only built for the "all" target if the option KDE4_BUILD_TESTS is enabled. Otherwise the rules for the target are created but not built by default. You can build them by manually building the target. | ||
| + | KDESRCDIR is set to the source directory of the test, this can be used with KGlobal::dirs()->addResourceDir( "data", KDESRCDIR ); to be able to use xmlgui and other things in the test, that normally require installation | ||
| + | |||
| + | * KDE4_UPDATE_ICONCACHE() | ||
| + | |||
| + | Notifies the icon cache that new icons have been installed by updating mtime of ${ICON_INSTALL_DIR}/hicolor directory. | ||
| + | |||
| + | * KDE4_INSTALL_ICONS( path theme) | ||
| + | |||
| + | Installs all png and svgz files in the current directory to the icon directory given in path, in the subdirectory for the given icon theme. | ||
| + | |||
| + | * KDE4_CREATE_HANDBOOK( docbookfile ) | ||
| + | |||
| + | Create the handbook from the docbookfile (using meinproc) | ||
| + | |||
| + | * KDE4_INSTALL_HANDBOOK() | ||
| + | |||
| + | Install the handbook documentation | ||
| + | |||
* KDE4_SET_CUSTOM_TARGET_PROPERTY | * KDE4_SET_CUSTOM_TARGET_PROPERTY | ||
* KDE4_GET_CUSTOM_TARGET_PROPERTY | * KDE4_GET_CUSTOM_TARGET_PROPERTY | ||
| Line 71: | Line 145: | ||
* KDE4_HANDLE_AUTOMOC | * KDE4_HANDLE_AUTOMOC | ||
* KDE4_CREATE_FINAL_FILES | * KDE4_CREATE_FINAL_FILES | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
* KDE4_REMOVE_OBSOLETE_CMAKE_FILES | * KDE4_REMOVE_OBSOLETE_CMAKE_FILES | ||
* KDE4_NO_ENABLE_FINAL | * KDE4_NO_ENABLE_FINAL | ||
| − | |||
A page to document the variables, macros and other useful stuff we have to use CMake as the KDE4 buildsystem.
The tools required to compile KDE software:
The location of the KDE libraries:
The locations of install directories. They are all interpreted relative to CMAKE_INSTALL_PREFIX:
Lots of useful macros:
Use this to add Qt designer ui files to your application/library.
Use this to add Qt designer ui files from Qt version 3 to your application/library.
Use this to add KDE config compiler files to your application/library. Use optional GENERATE_MOC to generate moc if you use signals in your kcfg files.
Use this to add widget description files for the makekdewidgets code generator for Qt Designer plugins.
Create a KDE plugin (KPart, kioslave, etc.) from the given source files. It supports KDE4_ENABLE_FINAL. If WITH_PREFIX is given, the resulting plugin will have the prefix "lib", otherwise it won't. It creates and installs an appropriate libtool la-file.
Create a KDE application in the form of a module loadable via kdeinit. A library named kdeinit_<name> will be created and a small executable which links to it. It supports KDE4_ENABLE_FINAL If the executable has to be run from the buildtree (e.g. unit tests and code generators used later on when compiling), set the option RUN_UNINSTALLED. If the executable doesn't have a GUI, use the option NOGUI. By default on OS X application bundles are created, with the NOGUI option no bundles but simple executables are created. Currently it doesn't have any effect on other platforms.
Equivalent to ADD_EXECUTABLE(), but additionally adds some more features: -support for KDE4_ENABLE_FINAL -support for automoc -automatic RPATH handling If the executable has to be run from the buildtree (e.g. unit tests and code generators used later on when compiling), set the option RUN_UNINSTALLED. If the executable doesn't have a GUI, use the option NOGUI. By default on OS X application bundles are created, with the NOGUI option no bundles but simple executablesare created. Currently it doesn't have any effect on other platforms.
Equivalent to ADD_LIBRARY(), but additionally it supports KDE4_ENABLE_FINAL and under Windows it adds a -DMAKE_<name>_LIB definition to the compilation.
add a unit test, which is executed when running make test it will be built with RPATH poiting to the build dir The targets are always created, but only built for the "all" target if the option KDE4_BUILD_TESTS is enabled. Otherwise the rules for the target are created but not built by default. You can build them by manually building the target. The name of the target can be specified using TESTNAME <targetname>, if it is not given the macro will default to the <testname>
add an test executable it will be built with RPATH poiting to the build dir The targets are always created, but only built for the "all" target if the option KDE4_BUILD_TESTS is enabled. Otherwise the rules for the target are created but not built by default. You can build them by manually building the target. KDESRCDIR is set to the source directory of the test, this can be used with KGlobal::dirs()->addResourceDir( "data", KDESRCDIR ); to be able to use xmlgui and other things in the test, that normally require installation
Notifies the icon cache that new icons have been installed by updating mtime of ${ICON_INSTALL_DIR}/hicolor directory.
Installs all png and svgz files in the current directory to the icon directory given in path, in the subdirectory for the given icon theme.
Create the handbook from the docbookfile (using meinproc)
Install the handbook documentation