diff options
author | Alex Neundorf <neundorf@kde.org> | 2011-07-02 15:50:05 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2011-07-02 15:50:05 (GMT) |
commit | a91d662f46fd2781fc5a3b73c2d244ac6dc2a343 (patch) | |
tree | 07f0f8c48d755ec9676defc742bbaf64d348f5be /Source/cmakemain.cxx | |
parent | b976e70063008c0633cb5dd4ecb1f40278c67935 (diff) | |
download | CMake-a91d662f46fd2781fc5a3b73c2d244ac6dc2a343.zip CMake-a91d662f46fd2781fc5a3b73c2d244ac6dc2a343.tar.gz CMake-a91d662f46fd2781fc5a3b73c2d244ac6dc2a343.tar.bz2 |
Add find-package mode, which does nothing yet
-add command line argument --find-package and handle it,
i.e. call an empty function cmake::FindPackage()
-add basic help
Alex
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r-- | Source/cmakemain.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 663ce8f..ae4529a 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -102,6 +102,9 @@ 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. "}, {"--graphviz=[file]", "Generate graphviz of dependencies.", "Generate a graphviz input file that will contain all the library and " "executable dependencies in the project."}, @@ -434,6 +437,7 @@ int do_cmake(int ac, char** av) bool list_help = false; bool view_only = false; bool script_mode = false; + bool find_package_mode = false; std::vector<std::string> args; for(int i =0; i < ac; ++i) { @@ -487,6 +491,12 @@ int do_cmake(int ac, char** av) args.push_back(av[i]); } } + else if (!command && strncmp(av[i], "--find-package", + strlen("--find-package")) == 0) + { + find_package_mode = true; + args.push_back(av[i]); + } else { args.push_back(av[i]); @@ -511,7 +521,8 @@ int do_cmake(int ac, char** av) cmake cm; cmSystemTools::SetErrorCallback(cmakemainErrorCallback, (void *)&cm); cm.SetProgressCallback(cmakemainProgressCallback, (void *)&cm); - cm.SetScriptMode(script_mode); + cm.SetScriptMode(script_mode || find_package_mode); + cm.SetFindPackageMode(find_package_mode); int res = cm.Run(args, view_only); if ( list_cached || list_all_cached ) |