Create a tutorial.cxx file with the following code:

#include 

using namespace std;

int main()
{
 cout<<"Hello world"<<endl;
 return 0;
}

Create a CMakeLists.txt in the same folder of tutorial.cxx with the following code:

cmake_minimum_required(VERSION 2.6)
project(Tutorial)

add_executable(Tutorial tutorial.cxx)

In order to keep the build files easy to remove, create a build folder by running

mkdir build && cd build

Run Cmake and then make

cmake .. && make