CMake will find all previous settings in the cache, such as the choice of generator, and re-use them. On subsequent runs, instead of passing the source folder path to the cmake command line, you can simply specify the path to the existing binary folder. If you change your mind about the value of DEMO_ENABLE_MULTISAMPLE, you can re-run CMake at any time. cmake -G "Visual Studio 15 2017" -DDEMO_ENABLE_MULTISAMPLE=1. Other projects have different configuration options. The value of this variable is also stored in the cache so that it persists during subsequent runs. Changing the value of DEMO_ENABLE_MULTISAMPLE will change the contents of demo-config.h, a header file that’s generated by CMakeLists.txt during the configure step. You can enable this configuration option by specifying -DDEMO_ENABLE_MULTISAMPLE=1 on the cmake command line. For example, the CMakeDemo project has a configuration option DEMO_ENABLE_MULTISAMPLE that defaults to 0. If there are project-specific configuration options, you can specify those on the command line as well. (If you don’t like its choice, you can always delete the binary folder and start over.) mkdir build If you omit the -G option, cmake will choose one for you. Specify the desired generator using the -G option. For a list of available generators, run cmake -help.Ĭreate the binary folder, cd to that folder, then run cmake, specifying the path to the source folder on the command line. You’ll often want to tell CMake which generator to use. For CMakeDemo on Windows, you can run setup-win32.py. Running CMake from the Command Lineīefore running CMake, make sure you have the required dependencies for your project and platform. If you re-run CMake on the same binary folder, many of the slow steps are skipped during subsequent runs, thanks to the cache. In a more sophisticated project, the configure step might also test the availability of system functions (as a traditional Unix configure script would), or define a special “install” target (to help create a distributable package).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |