5.3.2 : Le fichier CMakeLists.txt
Écrire le fichier CMakeLists.txt est assez simple :
On commence par définir notre project comme d'habitude
1 2 |
project(TestNvcpp) cmake_minimum_required(VERSION 3.0) |
On ajoute quelques flags de compilation (le fameux -stdpar, une option d'optimisation basique, les warnings et l'activation de C++17) :
1 |
set(CMAKE_CXX_FLAGS "-stdpar=gpu -O1 -Wall -std=c++17") |
On créé notre exécutable :
1 |
add_executable(test_nvcpp main.cpp)
|
Le fichier CMakeLists.txt complet :
1 2 3 4 |
project(TestNvcpp) cmake_minimum_required(VERSION 3.0) set(CMAKE_CXX_FLAGS "-stdpar=gpu -O1 -Wall -std=c++17") add_executable(test_nvcpp main.cpp) |
Le fichier CMakeLists.txt est disponible ici.