7 La compilation

Comme toujours, on se créé un dossier build :

mkdir build

Ensuite on va dedans :

cd build

On lance CMake

cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done

Puis Make

make
Scanning dependencies of target exemple_plist
[100%] Building CXX object src/CMakeFiles/exemple_plist.dir/main.cpp.o
Linking CXX executable exemple_plist
[100%] Built target exemple_plist

Et voilà, le programme est compilé.