2.3 La compilation

Aller, on recommence.

On créé un dossier build dans notre projet :

mkdir build

Ensuite 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

Il nous dit bien (vers la fin -- Found Qt4: /usr/bin/qmake (found version "4.7.4")). Donc il a trouver Qt4.

Ensuite on compile avec make :

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

Et voilà, notre programme est compilé.