CMake:How To Build KDE4 Software: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
No edit summary
(Replace content with link to new CMake community wiki)
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Let's just start with a simple example for an application, let's name it, well, kFoo:
{{CMake/Template/Moved}}
<pre>
# give the project a name, so that the project files
# for KDevelop/XCode/MSVC will have a good name
project(kfoo)


# find the KDE 4 installation
This page has moved [https://gitlab.kitware.com/cmake/community/wikis/doc/tutorials/How-To-Build-KDE4-Software here].
find_package(KDE4 REQUIRED)
 
# setup the required include dirs
include_directories( ${KDE4_INCLUDES} )
 
# the source files of your project
set(mySources main.cpp mywidget.cpp mypart.cpp)
 
# automoc handling
kde4_automoc( ${mySources} )
 
# create an executable named kfoo from the sources
kde4_add_executable(kfoo ${mySources})
 
# link kfoo to the kdeui and the kparts libraries
target_link_libraries(kfoo ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS} )
 
# install kfoo, its desktop file and its icons
install_targets( /bin kfoo)
install_files( ${XDG_APPS_DIR} FILES kfoo.desktop)
kde4_install_icons( ${ICON_INSTALL_DIR} hicolor)
</pre>

Latest revision as of 15:40, 30 April 2018


The CMake community Wiki has moved to the Kitware GitLab Instance.

This page has moved here.