cmake_minimum_required (VERSION 3.6) # project name project ("Hello World") # generate the executable binary file (located in build) # # usage: add_executable( ) add_executable(Hello hello.c) # generate binary file for further .c files # # usage: add_library( ) # e.g. add_library(Test test.c) # use in case you're locating your header files for test.c in a separate directory, such as "include" #target_include_directories(Test PUBLIC include) # link your separate c files to your source file containing the main # # usage: target_link_libraries(
) # e.g. target_link_libraries(Hello Test)