3.2.2 : Le CMakeLists.txt



Écrivons le fichier CMakeLists.txt.



On créé notre programme avec le main.cpp que l'on vient de créer
1
add_executable(gray_scott2pic main.cpp)


On change les options de compilation :de cette manière car nous aurons besoin par la suite de compiler avec différentes options nos autres programmes et bibliothèque :
1
set_property(TARGET gray_scott2pic PROPERTY COMPILE_FLAGS "-O3")


Enfin on ajoute les dépendences de notre programme :
1
target_link_libraries(gray_scott2pic gray_scott_data_format tensor_alloc phoenix_png option_parser data_stream string_utils ${HDF5_CXX_LIBRARIES} TBB::tbb)


Le fichier CMakeLists.txt complet :

1
2
3
add_executable(gray_scott2pic main.cpp)
set_property(TARGET gray_scott2pic PROPERTY COMPILE_FLAGS "-O3")
target_link_libraries(gray_scott2pic gray_scott_data_format tensor_alloc phoenix_png option_parser data_stream string_utils ${HDF5_CXX_LIBRARIES} TBB::tbb)


Vous pouvez le télécharger ici.