Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Where to find cmake tutorialconfig.h in cmake?


Asked by Kairi Underwood on Nov 30, 2021 FAQ



Using your favorite editor, create TutorialConfig.h.in in the source directory with the following contents: When CMake configures this header file the values for @Tutorial_VERSION_MAJOR@ and @Tutorial_VERSION_MINOR@ will be replaced.
Similarly,
To tell CMake to generate the config.h for us, we update our CMakeLists.txt file: Note that we save the config.h.in file in our source directory and the generated config.h is in the build directory. This means that this file is set a configure time and several out-of-source builds can have different config.h files.
Furthermore, Many of these topics have been introduced in Mastering CMake as separate issues but seeing how they all work together in an example project can be very helpful. This tutorial can be found in the Tests/Tutorial directory of the CMake source code tree. Each step has its own subdirectory containing a complete copy of the tutorial for that step.
Moreover,
The first step is to add an option to the top level CMakeLists.txt file. This will show up in the CMake GUI with a default value of ON that the user can change as desired. This setting will be stored in the cache so that the user does not need to keep setting it each time they run CMake on this project.
Accordingly,
To change the default CMake settings in Visual Studio 2017, choose CMake > Change CMake Settings > CMakeLists.txt from the main menu. Or, right-click CMakeLists.txt in Solution Explorer and choose Change CMake Settings. Visual Studio then creates a new CMakeSettings.json file in your root project folder.