diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-04-28 13:00:10 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-04-28 13:00:10 (GMT) |
commit | e841dde6c3a9229d53c8d2fdf00ce5073cadf016 (patch) | |
tree | fea3828f9eecd82116c1cda09429f99d7dd81d16 /Source | |
parent | e6d820ed49dfa56f7ed7df2fa09db7828a57fcae (diff) | |
download | CMake-e841dde6c3a9229d53c8d2fdf00ce5073cadf016.zip CMake-e841dde6c3a9229d53c8d2fdf00ce5073cadf016.tar.gz CMake-e841dde6c3a9229d53c8d2fdf00ce5073cadf016.tar.bz2 |
ENH: merge changes from main tree
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalBorlandMakefileGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 4 | ||||
-rw-r--r-- | Source/cmGlobalKdevelopGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalMSYSMakefileGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalMinGWMakefileGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalNMakeMakefileGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 16 | ||||
-rw-r--r-- | Source/cmGlobalWatcomWMakeGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 45 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 62 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/cmTest.cxx | 1 | ||||
-rw-r--r-- | Source/cmake.cxx | 121 | ||||
-rw-r--r-- | Source/cmake.h | 2 | ||||
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 14 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 2 |
18 files changed, 241 insertions, 55 deletions
diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index e33c518..b1efb70 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -24,7 +24,7 @@ cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator() this->EmptyRuleHackDepends = "NUL"; this->FindMakeProgramFile = "CMakeBorlandFindMake.cmake"; this->ForceUnixPaths = false; - this->ToolSupportsColorVT100 = false; + this->ToolSupportsColor = true; } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 812ed51..a18073f 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -35,7 +35,7 @@ cmGlobalGenerator::cmGlobalGenerator() this->ForceUnixPaths = false; // By default do not try to support color. - this->ToolSupportsColorVT100 = false; + this->ToolSupportsColor = false; } cmGlobalGenerator::~cmGlobalGenerator() diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 9325107..e8f2634 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -127,7 +127,7 @@ public: static int s_TryCompileTimeout; bool GetForceUnixPaths() {return this->ForceUnixPaths;} - bool GetToolSupportsColorVT100() { return this->ToolSupportsColorVT100; } + bool GetToolSupportsColor() { return this->ToolSupportsColor; } ///! return the language for the given extension const char* GetLanguageFromExtension(const char* ext); ///! is an extension to be ignored @@ -204,7 +204,7 @@ protected: std::vector<std::string> depends, bool depends_on_all = false); bool ForceUnixPaths; - bool ToolSupportsColorVT100; + bool ToolSupportsColor; cmStdString FindMakeProgramFile; cmStdString ConfiguredFilesPath; cmake *CMakeInstance; diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index 37e4542..f40722c 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -28,7 +28,7 @@ cmGlobalKdevelopGenerator::cmGlobalKdevelopGenerator() // This type of makefile always requires unix style paths this->ForceUnixPaths = true; this->FindMakeProgramFile = "CMakeUnixFindMake.cmake"; - this->ToolSupportsColorVT100 = false; + this->ToolSupportsColor = false; } ///! Create a local generator appropriate to this Global Generator diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx index a94a1b5..98862df 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.cxx +++ b/Source/cmGlobalMSYSMakefileGenerator.cxx @@ -23,7 +23,7 @@ cmGlobalMSYSMakefileGenerator::cmGlobalMSYSMakefileGenerator() { this->FindMakeProgramFile = "CMakeMSYSFindMake.cmake"; this->ForceUnixPaths = true; - this->ToolSupportsColorVT100 = true; + this->ToolSupportsColor = true; } std::string diff --git a/Source/cmGlobalMinGWMakefileGenerator.cxx b/Source/cmGlobalMinGWMakefileGenerator.cxx index e924ca0..5ede978 100644 --- a/Source/cmGlobalMinGWMakefileGenerator.cxx +++ b/Source/cmGlobalMinGWMakefileGenerator.cxx @@ -22,7 +22,7 @@ cmGlobalMinGWMakefileGenerator::cmGlobalMinGWMakefileGenerator() { this->FindMakeProgramFile = "CMakeMinGWFindMake.cmake"; this->ForceUnixPaths = true; - this->ToolSupportsColorVT100 = false; + this->ToolSupportsColor = true; } void cmGlobalMinGWMakefileGenerator::EnableLanguage(std::vector<std::string>const& l, diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index bd9952b..3784a80 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx @@ -22,7 +22,7 @@ cmGlobalNMakeMakefileGenerator::cmGlobalNMakeMakefileGenerator() { this->FindMakeProgramFile = "CMakeNMakeFindMake.cmake"; this->ForceUnixPaths = false; - this->ToolSupportsColorVT100 = false; + this->ToolSupportsColor = true; } void cmGlobalNMakeMakefileGenerator::EnableLanguage(std::vector<std::string>const& l, diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index ee5279e..1a92293 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -26,7 +26,7 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3() // This type of makefile always requires unix style paths this->ForceUnixPaths = true; this->FindMakeProgramFile = "CMakeUnixFindMake.cmake"; - this->ToolSupportsColorVT100 = true; + this->ToolSupportsColor = true; } void cmGlobalUnixMakefileGenerator3 @@ -823,7 +823,7 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule if (lg2 == lg || !lg->GetParent()) { // for each target Generate the rule files for each target. - cmTargets& targets = lg->GetMakefile()->GetTargets(); + cmTargets& targets = lg2->GetMakefile()->GetTargets(); for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t) { if((t->second.GetType() == cmTarget::EXECUTABLE) || diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index ff67fd0..f1bf776 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -40,6 +40,22 @@ void cmGlobalVisualStudio7Generator::EnableLanguage(std::vector<std::string>cons // Create list of configurations requested by user's cache, if any. this->cmGlobalGenerator::EnableLanguage(lang, mf); this->GenerateConfigurations(mf); + + // if this environment variable is set, then copy it to + // a static cache entry. It will be used by + // cmLocalGenerator::ConstructScript, to add an extra PATH + // to all custom commands. This is because the VS IDE + // does not use the environment it is run in, and this allows + // for running commands and using dll's that the IDE environment + // does not know about. + const char* extraPath = cmSystemTools::GetEnv("CMAKE_MSVCIDE_RUN_PATH"); + if(extraPath) + { + mf->AddCacheDefinition("CMAKE_MSVCIDE_RUN_PATH", + extraPath, "Saved environment variable CMAKE_MSVCIDE_RUN_PATH", + cmCacheManager::STATIC); + } + } std::string cmGlobalVisualStudio7Generator::GenerateBuildCommand(const char* makeProgram, diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx index a040484..3e19c9e 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.cxx +++ b/Source/cmGlobalWatcomWMakeGenerator.cxx @@ -22,7 +22,7 @@ cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator() { this->FindMakeProgramFile = "CMakeFindWMake.cmake"; this->ForceUnixPaths = false; - this->ToolSupportsColorVT100 = false; + this->ToolSupportsColor = true; this->EmptyCommandsHack = "@cd ."; } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 6ada0d9..c0f029b 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1103,15 +1103,40 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs) } } - // Construct the ordered list. + // Get the project-specified include directories. std::vector<std::string>& includes = this->Makefile->GetIncludeDirectories(); + + // Support putting all the in-project include directories first if + // it is requested by the project. + if(this->Makefile->IsOn("CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE")) + { + const char* topSourceDir = this->Makefile->GetHomeDirectory(); + const char* topBinaryDir = this->Makefile->GetHomeOutputDirectory(); for(std::vector<std::string>::iterator i = includes.begin(); i != includes.end(); ++i) { - if(emitted.find(*i) == emitted.end()) + // Emit this directory only if it is a subdirectory of the + // top-level source or binary tree. + if(cmSystemTools::ComparePath(i->c_str(), topSourceDir) || + cmSystemTools::ComparePath(i->c_str(), topBinaryDir) || + cmSystemTools::IsSubDirectory(i->c_str(), topSourceDir) || + cmSystemTools::IsSubDirectory(i->c_str(), topBinaryDir)) + { + if(emitted.insert(*i).second) + { + dirs.push_back(*i); + } + } + } + } + + // Construct the final ordered include directory list. + for(std::vector<std::string>::iterator i = includes.begin(); + i != includes.end(); ++i) + { + if(emitted.insert(*i).second) { dirs.push_back(*i); - emitted.insert(*i); } } } @@ -1726,7 +1751,19 @@ cmLocalGenerator::ConstructScript(const cmCustomCommandLines& commandLines, script += this->Convert(workingDirectory, START_OUTPUT, SHELL); script += newline; } - + // for visual studio IDE add extra stuff to the PATH + // if CMAKE_MSVCIDE_RUN_PATH is set. + if(this->Makefile->GetDefinition("MSVC_IDE")) + { + const char* extraPath = this->Makefile->GetDefinition("CMAKE_MSVCIDE_RUN_PATH"); + if(extraPath) + { + script += "set PATH="; + script += extraPath; + script += ";%PATH%"; + script += newline; + } + } // Write each command on a single line. for(cmCustomCommandLines::const_iterator cl = commandLines.begin(); cl != commandLines.end(); ++cl) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 865f5a9..051b478 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -35,28 +35,6 @@ #include <memory> // auto_ptr #include <queue> -#define CMAKE_VT100_NORMAL "\33[0m" -#define CMAKE_VT100_BOLD "\33[1m" -#define CMAKE_VT100_UNDERLINE "\33[4m" -#define CMAKE_VT100_BLINK "\33[5m" -#define CMAKE_VT100_INVERSE "\33[7m" -#define CMAKE_VT100_FRONT_BLACK "\33[30m" -#define CMAKE_VT100_FRONT_RED "\33[31m" -#define CMAKE_VT100_FRONT_GREEN "\33[32m" -#define CMAKE_VT100_FRONT_YELLOW "\33[33m" -#define CMAKE_VT100_FRONT_BLUE "\33[34m" -#define CMAKE_VT100_FRONT_MAGENTA "\33[35m" -#define CMAKE_VT100_FRONT_CYAN "\33[36m" -#define CMAKE_VT100_FRONT_WHITE "\33[37m" -#define CMAKE_VT100_BACK_BLACK "\33[40m" -#define CMAKE_VT100_BACK_RED "\33[41m" -#define CMAKE_VT100_BACK_GREEN "\33[42m" -#define CMAKE_VT100_BACK_YELLOW "\33[43m" -#define CMAKE_VT100_BACK_BLUE "\33[44m" -#define CMAKE_VT100_BACK_MAGENTA "\33[45m" -#define CMAKE_VT100_BACK_CYAN "\33[46m" -#define CMAKE_VT100_BACK_WHITE "\33[47m" - //---------------------------------------------------------------------------- cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3() { @@ -532,7 +510,8 @@ cmLocalUnixMakefileGenerator3 if(this->WindowsShell) { makefileStream - << "SHELL = C:\\WINDOWS\\system32\\cmd.exe\n"; + << "SHELL = cmd.exe\n" + << "\n"; } else { @@ -876,32 +855,35 @@ cmLocalUnixMakefileGenerator3::AppendEcho(std::vector<std::string>& commands, EchoColor color) { // Choose the color for the text. - std::string prefix; - if(this->GlobalGenerator->GetToolSupportsColorVT100() && + std::string color_name; +#ifdef CMAKE_BUILD_WITH_CMAKE + if(this->GlobalGenerator->GetToolSupportsColor() && this->Makefile->IsOn("CMAKE_COLOR_MAKEFILE")) { + // See cmake::ExecuteEchoColor in cmake.cxx for these options. + // This color set is readable on both black and white backgrounds. switch(color) { case EchoNormal: break; case EchoDepend: - prefix = CMAKE_VT100_FRONT_MAGENTA; + color_name = "--magenta --bold "; break; case EchoBuild: - prefix = CMAKE_VT100_FRONT_GREEN; + color_name = "--green "; break; case EchoLink: - prefix = CMAKE_VT100_FRONT_RED; + color_name = "--red --bold "; break; case EchoGenerate: - prefix = CMAKE_VT100_FRONT_BLUE; + color_name = "--blue --bold "; break; case EchoGlobal: - prefix = CMAKE_VT100_FRONT_CYAN; + color_name = "--cyan "; break; } } - std::string suffix = prefix.empty()? "" : CMAKE_VT100_NORMAL; +#endif // Echo one line at a time. std::string line; @@ -914,16 +896,28 @@ cmLocalUnixMakefileGenerator3::AppendEcho(std::vector<std::string>& commands, if(*c != '\0' || !line.empty()) { // Add a command to echo this line. - std::string cmd = "@echo "; + std::string cmd; + if(color_name.empty()) + { + // Use the native echo command. + cmd = "@echo "; if(this->EchoNeedsQuote) { cmd += "\""; } - cmd += prefix; cmd += line; - cmd += suffix; if(this->EchoNeedsQuote) { + cmd += "\""; + } + } + else + { + // Use cmake to echo the text in color. + cmd = "@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) "; + cmd += color_name; + cmd += "\""; + cmd += line; cmd += "\""; } commands.push_back(cmd); diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index a73213a..bf8422a 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -562,6 +562,17 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() cmOStringStream depCmd; // TODO: Account for source file properties and directory-level // definitions when scanning for dependencies. +#if !defined(_WIN32) || defined(__CYGWIN__) + // This platform supports symlinks, so cmSystemTools will translate + // paths. Make sure PWD is set to the original name of the home + // output directory to help cmSystemTools to create the same + // translation table for the dependency scanning process. + depCmd << "cd " + << (this->LocalGenerator->Convert( + this->Makefile->GetHomeOutputDirectory(), + cmLocalGenerator::FULL, cmLocalGenerator::SHELL)) + << " && "; +#endif depCmd << "$(CMAKE_COMMAND) -E cmake_depends " << " \"" << this->GlobalGenerator->GetName() << "\" " diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx index affff8a..ee7d952 100644 --- a/Source/cmTest.cxx +++ b/Source/cmTest.cxx @@ -42,6 +42,7 @@ void cmTest::SetCommand(const char* command) command = ""; } this->Command = command; + cmSystemTools::ConvertToUnixSlashes(this->Command); } void cmTest::SetArguments(const std::vector<cmStdString>& args) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2c08ae3..cc55aa4 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -28,6 +28,7 @@ # include "cmDependsFortran.h" // For -E cmake_copy_f90_mod callback. # include "cmVariableWatch.h" # include "cmVersion.h" +# include <cmsys/Terminal.h> #endif // only build kdevelop generator on non-windows platforms @@ -1005,6 +1006,14 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args) return 1; } +#ifdef CMAKE_BUILD_WITH_CMAKE + // Internal CMake color makefile support. + else if (args[1] == "cmake_echo_color") + { + return cmake::ExecuteEchoColor(args); + } +#endif + // Tar files else if (args[1] == "tar" && args.size() > 3) { @@ -2344,3 +2353,115 @@ void cmake::GenerateGraphViz(const char* fileName) str << "}" << std::endl; } +//---------------------------------------------------------------------------- +#ifdef CMAKE_BUILD_WITH_CMAKE +int cmake::ExecuteEchoColor(std::vector<std::string>& args) +{ + // The arguments are + // argv[0] == <cmake-executable> + // argv[1] == cmake_echo_color + + // On some platforms (an MSYS prompt) cmsysTerminal may not be able + // to determine whether the stream is displayed on a tty. In this + // case it assumes no unless we tell it otherwise. Since we want + // color messages to be displayed for users we will assume yes. + // However, we can test for some situations when the answer is most + // likely no. + int assumeTTY = cmsysTerminal_Color_AssumeTTY; + if(cmSystemTools::GetEnv("DART_TEST_FROM_DART") || + cmSystemTools::GetEnv("DASHBOARD_TEST_FROM_CTEST")) + { + // Avoid printing color escapes during dashboard builds. + assumeTTY = 0; + } + + bool enabled = true; + int color = cmsysTerminal_Color_Normal; + bool newline = true; + for(unsigned int i=2; i < args.size(); ++i) + { + if(args[i].find("--switch=") == 0) + { + // Enable or disable color based on the switch value. + std::string value = args[i].substr(9); + if(!value.empty()) + { + if(cmSystemTools::IsOn(value.c_str())) + { + enabled = true; + } + else + { + enabled = false; + } + } + } + else if(args[i] == "--normal") + { + color = cmsysTerminal_Color_Normal; + } + else if(args[i] == "--black") + { + color = cmsysTerminal_Color_ForegroundBlack; + } + else if(args[i] == "--red") + { + color = cmsysTerminal_Color_ForegroundRed; + } + else if(args[i] == "--green") + { + color = cmsysTerminal_Color_ForegroundGreen; + } + else if(args[i] == "--yellow") + { + color = cmsysTerminal_Color_ForegroundYellow; + } + else if(args[i] == "--blue") + { + color = cmsysTerminal_Color_ForegroundBlue; + } + else if(args[i] == "--magenta") + { + color = cmsysTerminal_Color_ForegroundMagenta; + } + else if(args[i] == "--cyan") + { + color = cmsysTerminal_Color_ForegroundCyan; + } + else if(args[i] == "--white") + { + color = cmsysTerminal_Color_ForegroundWhite; + } + else if(args[i] == "--bold") + { + color |= cmsysTerminal_Color_ForegroundBold; + } + else if(args[i] == "--no-newline") + { + newline = false; + } + else if(args[i] == "--newline") + { + newline = true; + } + else if(enabled) + { + // Color is enabled. Print with the current color. + cmsysTerminal_cfprintf(color | assumeTTY, stdout, "%s%s", + args[i].c_str(), newline? "\n" : ""); + } + else + { + // Color is disabled. Print without color. + fprintf(stdout, "%s%s", args[i].c_str(), newline? "\n" : ""); + } + } + + return 0; +} +#else +int cmake::ExecuteEchoColor(std::vector<std::string>&) +{ + return 1; +} +#endif diff --git a/Source/cmake.h b/Source/cmake.h index ca3e0bc..18d2587 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -315,6 +315,8 @@ protected: void CleanupCommandsAndMacros(); void GenerateGraphViz(const char* fileName); + + static int ExecuteEchoColor(std::vector<std::string>& args); cmVariableWatch* VariableWatch; diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 1cd4b4a..2269db0 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -94,6 +94,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET(KWSYS_USE_SystemTools 1) SET(KWSYS_USE_CommandLineArguments 1) SET(KWSYS_USE_FundamentalType 1) + SET(KWSYS_USE_Terminal 1) ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) #----------------------------------------------------------------------------- @@ -436,7 +437,7 @@ FOREACH(cpp ${cppclasses}) ENDFOREACH(cpp) # Add selected C components. -FOREACH(c Process Base64 FundamentalType) +FOREACH(c Process Base64 FundamentalType Terminal) IF(KWSYS_USE_${c}) SET(KWSYS_H_FILES ${KWSYS_H_FILES} ${c}) ENDIF(KWSYS_USE_${c}) @@ -463,10 +464,12 @@ IF(KWSYS_USE_Process) ENDIF(NOT UNIX) ENDIF(KWSYS_USE_Process) -# Add sources for Base64 encoding. -IF(KWSYS_USE_Base64) - SET(KWSYS_C_SRCS ${KWSYS_C_SRCS} Base64.c) -ENDIF(KWSYS_USE_Base64) +# Add selected C sources. +FOREACH(c Base64 Terminal) + IF(KWSYS_USE_${c}) + SET(KWSYS_C_SRCS ${KWSYS_C_SRCS} ${c}.c) + ENDIF(KWSYS_USE_${c}) +ENDFOREACH(c) # Configure headers of C++ classes and construct the list of sources. FOREACH(c ${KWSYS_CLASSES}) @@ -632,6 +635,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) FOREACH(test testProcess testFail + testTerminal ) ADD_EXECUTABLE(${test} ${test}.c) TARGET_LINK_LIBRARIES(${test} ${KWSYS_NAMESPACE}_c) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 6ab76b4..e70d3fc 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -3466,7 +3466,7 @@ bool SystemTools::IsSubDirectory(const char* cSubdir, const char* cDir) do { path = SystemTools::GetParentDirectory(path.c_str()); - if ( dir == path ) + if(SystemTools::ComparePath(dir.c_str(), path.c_str())) { return true; } |