KDevelop4/Manual/Getting started: A small CMake tutorial

From KDE UserBase Wiki
Revision as of 07:41, 8 December 2010 by Syron (talk | contribs)

Under Construction

This is a new page, currently under construction!


In this chapter, you will learn how to build your CMake based project and how to add files.

If you want do get a more in-depth tutorial on CMake, see Appendix B: CMake for bigger projects.

Adding a file

Right-click on the project's main target and select Create File. You will be asked for a filename – enter helloworld.cpp here and click on "OK".

The dialog that pops up now shows the changes that will be made to CMakeLists.txt. For now, click on "OK".

The newly created file is now opened in the editor. Enter the following code and save the file:

void heyWorld() {
    std::cout << "Hello, world!";
}