As mentioned in the linked answer, this is an undocumented option, but looking at the source code shows its effect:
In cmake::SetArgs() :
if(arg.find("-H",0) == 0) { directoriesSet = true; std::string path = arg.substr(2); path = cmSystemTools::CollapseFullPath(path); cmSystemTools::ConvertToUnixSlashes(path); this->SetHomeDirectory(path);
The last call to SetHomeDirectory actually sets the source directory for the project. The -B option (also undocumented), in turn, sets the binary directory.
If these options are not set, the binary directory will be the current folder in which cmake is running, and the source directory can be specified as a positional argument (if not found, the source folder will also be the current working folder).
Akos Bannerth Jun 27 '15 at 18:26 2015-06-27 18:26
source share