diff options
author | Patrick Gansterer <paroga@paroga.com> | 2012-11-29 15:36:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-11-30 12:59:25 (GMT) |
commit | dce54b103af0ee1627de9e0cf04a5e390442a929 (patch) | |
tree | f56bd77d241bdb0a2641297b5340fdbdd9335143 /Source/cmake.cxx | |
parent | d5ac791366595be307896e9894c66815c1e1eb2f (diff) | |
download | CMake-dce54b103af0ee1627de9e0cf04a5e390442a929.zip CMake-dce54b103af0ee1627de9e0cf04a5e390442a929.tar.gz CMake-dce54b103af0ee1627de9e0cf04a5e390442a929.tar.bz2 |
Add command to generate environment for a Windows CE SDK
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 1424a11..fba4860 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -82,6 +82,7 @@ #if defined(CMAKE_HAVE_VS_GENERATORS) #include "cmCallVisualStudioMacro.h" +#include "cmVisualStudioWCEPlatformParser.h" #endif #if !defined(CMAKE_BOOT_MINGW) @@ -1143,6 +1144,10 @@ void CMakeCommandUsage(const char* program) << "Available on Windows only:\n" << " comspec - on windows 9x use this for RunCommand\n" << " delete_regv key - delete registry value\n" + << " env_vs8_wince sdkname - displays a batch file which sets the " + "environment for the provided Windows CE SDK installed in VS2005\n" + << " env_vs9_wince sdkname - displays a batch file which sets the " + "environment for the provided Windows CE SDK installed in VS2008\n" << " write_regv key value - write registry value\n" #else << "Available on UNIX only:\n" @@ -1808,6 +1813,14 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args) } return cmWin32ProcessExecution::Windows9xHack(command.c_str()); } + else if (args[1] == "env_vs8_wince" && args.size() == 3) + { + return cmake::WindowsCEEnvironment("8.0", args[2]); + } + else if (args[1] == "env_vs9_wince" && args.size() == 3) + { + return cmake::WindowsCEEnvironment("9.0", args[2]); + } #endif } @@ -4001,6 +4014,29 @@ static bool cmakeCheckStampList(const char* stampList) return true; } +//---------------------------------------------------------------------------- +int cmake::WindowsCEEnvironment(const char* version, const std::string& name) +{ +#if defined(CMAKE_HAVE_VS_GENERATORS) + cmVisualStudioWCEPlatformParser parser(name.c_str()); + parser.ParseVersion(version); + if (parser.Found()) + { + std::cout << "@echo off" << std::endl; + std::cout << "echo Environment Selection: " << name << std::endl; + std::cout << "set PATH=" << parser.GetPathDirectories() << std::endl; + std::cout << "set INCLUDE=" << parser.GetIncludeDirectories() <<std::endl; + std::cout << "set LIB=" << parser.GetLibraryDirectories() <<std::endl; + return 0; + } +#else + (void)version; +#endif + + std::cerr << "Could not find " << name; + return -1; +} + // For visual studio 2005 and newer manifest files need to be embeded into // exe and dll's. This code does that in such a way that incremental linking // still works. |