![]() ![]() CMAKE_CURRENT_BUILD_DIR: that’s the build directory associated with the source directory in which the CMakeLists is accessing this variable.For example, within quantize/share/CMakeLists.txt, that variable holds quantize/share CMAKE_CURRENT_SOURCE_DIR : that’s the source directory in which the CMakeLists, accessing this variable, is defined.CMAKE_BUILD_DIR : that’s the directory from which we called the cmake.CMAKE_SOURCE_DIR : that’s the root directory of your sources, in our case quantize.Within CMakeLists, various variables help you to define paths either to the source directory or the build directory: A bare minimal CMakeLists.txt should contain the following :Īdd_subdirectory ( src ) add_subdirectory ( share ) add_subdirectory ( doc ) add_subdirectory ( examples ) General setup of the projectĮverything starts with the root CMakeLists.txt file. If gtkmm-3.0 is available on your system, we compile the GUI, otherwise we don’t. All the smart things are defined in the CMakeLists.txt files (yes, there can be multiple such files). From these, the make command line can be issued and triggers all the necessary builds. The cmake command line tool is processing your sources according to configuration files named CMakeLists.txt and produces Makefiles and possibly generates or configures other files. ![]() The pipeline with CMake is depicted below. And see here, some well known projects do use CMake ! General principles That’s our menu, ready to go ? Fasten your seat belt…Oh wait, did I tell that it is going to be quite tough ? It is going to be quite tough because your are learning to program, the compilation questions are probably not that familiar to you, the questions about handling dependencies might just be an unknown territory but keep on working and ask questions to your teammates and teachers.
0 Comments
Leave a Reply. |