diff options
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r-- | Source/cmakemain.cxx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 1fe9e82..9f213a5 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -103,6 +103,11 @@ static const char * cmDocumentationOptions[][3] = "No configure or generate step is performed and the cache is not" " modified. If variables are defined using -D, this must be done " "before the -P argument."}, + {"--find-package", "Run in pkg-config like mode.", + "Search a package using find_package() and print the resulting flags " + "to stdout. This can be used to use cmake instead of pkg-config to find " + "installed libraries in plain Makefile-based projects or in " + "autoconf-based projects (via share/aclocal/cmake.m4)."}, {"--graphviz=[file]", "Generate graphviz of dependencies.", "Generate a graphviz input file that will contain all the library and " "executable dependencies in the project."}, @@ -434,7 +439,7 @@ int do_cmake(int ac, char** av) bool list_all_cached = false; bool list_help = false; bool view_only = false; - bool script_mode = false; + cmake::WorkingMode workingMode = cmake::NORMAL_MODE; std::vector<std::string> args; for(int i =0; i < ac; ++i) { @@ -482,12 +487,18 @@ int do_cmake(int ac, char** av) } else { - script_mode = true; + workingMode = cmake::SCRIPT_MODE; args.push_back(av[i]); i++; args.push_back(av[i]); } } + else if (!command && strncmp(av[i], "--find-package", + strlen("--find-package")) == 0) + { + workingMode = cmake::FIND_PACKAGE_MODE; + args.push_back(av[i]); + } else { args.push_back(av[i]); @@ -512,7 +523,7 @@ int do_cmake(int ac, char** av) cmake cm; cmSystemTools::SetErrorCallback(cmakemainErrorCallback, (void *)&cm); cm.SetProgressCallback(cmakemainProgressCallback, (void *)&cm); - cm.SetScriptMode(script_mode); + cm.SetWorkingMode(workingMode); int res = cm.Run(args, view_only); if ( list_cached || list_all_cached ) |