A collection of scripts that add context menu items for launching CMake from the OS file manager.
- Launches CMake GUI from the current folder's context menu
- Automatically sets the source and build directories
Up until CMake 3.12, we had to use the undocumented -H
command line option to specify the source directory (i.e. the directory containing CMakeLists.txt
).
Starting from CMake 3.13, a new -S
option has been added to specify the source directory.
Therefore, if you have CMake < 3.13, you must replace -S
with -H
in the scripts that are provided by this repo for your file manager.
(click on the file manager's name to go to the instructions)
Bug fixes and pull requests (e.g. adding support to more file managers) are welcome :)
For the "CMake GUI Here" menu item, the main trick is to launch cmake-gui
with the following arguments
# CMake <= 3.12
cmake-gui "-H<path to current folder>" "-B<path to current folder>/build"
# CMake >= 3.13
cmake-gui "-S<path to current folder>" "-B<path to current folder>/build"
Note that
"-H..."
/"-S..."
and"-B..."
are quoted- There are no spaces after
-H
/-S
and-B