summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-02-05 21:29:59 (GMT)
committerBrad King <brad.king@kitware.com>2015-02-05 21:44:56 (GMT)
commit69ac6d27555cd4819d0c7f40e4471c6f885e23ab (patch)
tree6d63228342fb1633fc0352f732d34d7b8f32da65 /Source
parent098160d5f2a1aa35d2f14c585dd87cefd8f56f41 (diff)
downloadCMake-69ac6d27555cd4819d0c7f40e4471c6f885e23ab.zip
CMake-69ac6d27555cd4819d0c7f40e4471c6f885e23ab.tar.gz
CMake-69ac6d27555cd4819d0c7f40e4471c6f885e23ab.tar.bz2
bootstrap: Enable color Makefile output
Build the needed infrastructure during bootstrap in order to allow "cmake -E cmake_echo_color" to be used unconditionally during generation.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx10
-rw-r--r--Source/cmSystemTools.cxx4
-rw-r--r--Source/cmSystemTools.h2
-rw-r--r--Source/cmcmd.cxx11
4 files changed, 4 insertions, 23 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index fbf2140..72d4ef0 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -27,10 +27,10 @@
#ifdef CMAKE_BUILD_WITH_CMAKE
# include "cmDependsFortran.h"
# include "cmDependsJava.h"
-# include <cmsys/Terminal.h>
#endif
#include <cmsys/auto_ptr.hxx>
+#include <cmsys/Terminal.h>
#include <queue>
@@ -1351,7 +1351,6 @@ cmLocalUnixMakefileGenerator3::AppendEcho(std::vector<std::string>& commands,
{
// Choose the color for the text.
std::string color_name;
-#ifdef CMAKE_BUILD_WITH_CMAKE
if(this->GlobalGenerator->GetToolSupportsColor() && this->ColorMakefile)
{
// See cmake::ExecuteEchoColor in cmake.cxx for these options.
@@ -1377,9 +1376,6 @@ cmLocalUnixMakefileGenerator3::AppendEcho(std::vector<std::string>& commands,
break;
}
}
-#else
- (void)color;
-#endif
// Echo one line at a time.
std::string line;
@@ -1617,14 +1613,10 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
targetName = targetName.substr(0, targetName.length()-4);
std::string message = "Scanning dependencies of target ";
message += targetName;
-#ifdef CMAKE_BUILD_WITH_CMAKE
cmSystemTools::MakefileColorEcho(
cmsysTerminal_Color_ForegroundMagenta |
cmsysTerminal_Color_ForegroundBold,
message.c_str(), true, color);
-#else
- fprintf(stdout, "%s\n", message.c_str());
-#endif
return this->ScanDependencies(dir.c_str(), validDependencies);
}
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index e9735ed..ec3d846 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -27,10 +27,10 @@
#if defined(CMAKE_BUILD_WITH_CMAKE)
# include "cmArchiveWrite.h"
# include <cm_libarchive.h>
-# include <cmsys/Terminal.h>
#endif
#include <cmsys/stl/algorithm>
#include <cmsys/FStream.hxx>
+#include <cmsys/Terminal.h>
#if defined(_WIN32)
# include <windows.h>
@@ -2284,7 +2284,6 @@ std::string const& cmSystemTools::GetCMakeRoot()
}
//----------------------------------------------------------------------------
-#if defined(CMAKE_BUILD_WITH_CMAKE)
void cmSystemTools::MakefileColorEcho(int color, const char* message,
bool newline, bool enabled)
{
@@ -2314,7 +2313,6 @@ void cmSystemTools::MakefileColorEcho(int color, const char* message,
fprintf(stdout, "%s%s", message, newline? "\n" : "");
}
}
-#endif
//----------------------------------------------------------------------------
bool cmSystemTools::GuessLibrarySOName(std::string const& fullPath,
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 361f42e..c59ae96 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -428,11 +428,9 @@ public:
static std::string const& GetCMakeCursesCommand();
static std::string const& GetCMakeRoot();
-#if defined(CMAKE_BUILD_WITH_CMAKE)
/** Echo a message in color using KWSys's Terminal cprintf. */
static void MakefileColorEcho(int color, const char* message,
bool newLine, bool enabled);
-#endif
/** Try to guess the soname of a shared library. */
static bool GuessLibrarySOName(std::string const& fullPath,
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 28fcd27..6b04d26 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -18,12 +18,12 @@
#if defined(CMAKE_BUILD_WITH_CMAKE)
# include "cmDependsFortran.h" // For -E cmake_copy_f90_mod callback.
-# include <cmsys/Terminal.h>
#endif
#include <cmsys/Directory.hxx>
#include <cmsys/Process.h>
#include <cmsys/FStream.hxx>
+#include <cmsys/Terminal.h>
#if defined(CMAKE_HAVE_VS_GENERATORS)
#include "cmCallVisualStudioMacro.h"
@@ -753,12 +753,12 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
{
return cmcmd::VisualStudioLink(args, 2);
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
// Internal CMake color makefile support.
else if (args[1] == "cmake_echo_color")
{
return cmcmd::ExecuteEchoColor(args);
}
+#ifdef CMAKE_BUILD_WITH_CMAKE
else if (args[1] == "cmake_autogen" && args.size() >= 4)
{
cmQtAutoGenerators autogen;
@@ -987,7 +987,6 @@ bool cmcmd::SymlinkInternal(std::string const& file, std::string const& link)
}
//----------------------------------------------------------------------------
-#ifdef CMAKE_BUILD_WITH_CMAKE
int cmcmd::ExecuteEchoColor(std::vector<std::string>& args)
{
// The arguments are
@@ -1073,12 +1072,6 @@ int cmcmd::ExecuteEchoColor(std::vector<std::string>& args)
return 0;
}
-#else
-int cmcmd::ExecuteEchoColor(std::vector<std::string>&)
-{
- return 1;
-}
-#endif
//----------------------------------------------------------------------------
int cmcmd::ExecuteLinkScript(std::vector<std::string>& args)