Adding a new source.c file to the project

Now the CMake window will appear and now your file name should automatically be added to the add_executable list. Line number 2 in red below. Press OK.

Since we're here, you need to know that you need to maintain line #3. The libraries that the linker must link to. One ODD thing, the first element in the list MUST BE the name of your binary (program). If you want to add any other C or CPP files to your project, you can add them to line #2 in the add_executable list.

Finally, you probably won't need to adjust the link_directories (line #1), unless you add or create your own libraries. Then if there are new directories you want the linker to search through, then add them here. But if you don't know what you're doing... then it is safe to leave this line aone.