CmakeLists.txt if not already created. This is a bit harder to use than a Makefile, but most of the time, you won't have to do something complicated. A CMake file is generating an unreadable Makefile inside the build folder.
cmake_minimum_required(VERSION 3.16.3) # or 17 / your version project(nom_projet C) # project name set(CMAKE_C_STANDARD 99) # standard # create a target with a name # and add all the files add_executable(name main.c main.h ...)
If the name is
prim then after compiling your CMakelist you will have here
and you can
- select this target as the compiled one/run one
- change the profile
- run this target
(A profile is a configuration. You may use these if you want to try to build/run using different configurations, but that should not be the case most of the time).
set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) target_link_libraries(my_app PRIVATE Threads::Threads)
target_link_libraries(my_app PRIVATE m)
Include a folder of *.h