Figuring out CMakeLists.txt and MakeFile
已回答
Hello There,
I am very new to using CMakeList.txt and Makefiles and I am having trouble making this program work. I want to figure out how to translate the functionality of the makefile into the CMakeList.txt file. Does anyone have any clue on where I can start?
Thank You!


请先登录再写评论。
Hi! We have a quick CMake tutorial in order to help our users to get to know CMake: https://www.jetbrains.com/help/clion/quick-cmake-tutorial.html. Also you can find a lot of useful CMake variables with descriptions in this wiki: https://cmake.org/Wiki/CMake_Useful_Variables. And here is the CMake documentation: https://cmake.org/cmake/help/v3.10/.
For example, compiler flags can be specified by adding the following line to the CMakeLists.txt:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
You should add all source files needed to construct the final executable to add_executable. Note that you need to have main() defined in one of these files.
Thank You! I will go ahead and read those documents and see if they help.