4.6 La compilation du programme

Et c'est reparti, on créé un dossier build.

mkdir build

On va dedans :

cd build

On appel 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
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found Qt4: /usr/bin/qmake (found version "4.7.4")
-- Configuring done
-- Generating done

Puis on appel make :

make
[ 33%] Generating TextEditor.moc
Scanning dependencies of target textEditor
[ 66%] Building CXX object CMakeFiles/textEditor.dir/TextEditor.cpp.o
[100%] Building CXX object CMakeFiles/textEditor.dir/main.cpp.o
Linking CXX executable textEditor
[100%] Built target textEditor

Voilà, c'est fini pour la compilation.