diff options
-rw-r--r-- | Modules/FindBISON.cmake | 13 | ||||
-rw-r--r-- | Modules/FindGettext.cmake | 15 | ||||
-rw-r--r-- | Modules/FindPNG.cmake | 17 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 57 | ||||
-rw-r--r-- | Source/cmCTest.h | 4 | ||||
-rw-r--r-- | Source/cmLocalVisualStudioGenerator.cxx | 14 | ||||
-rw-r--r-- | Source/kwsys/kwsysDateStamp.cmake | 2 |
7 files changed, 101 insertions, 21 deletions
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake index e855a27..edde9eb 100644 --- a/Modules/FindBISON.cmake +++ b/Modules/FindBISON.cmake @@ -67,8 +67,17 @@ IF(BISON_EXECUTABLE) IF(NOT ${BISON_version_result} EQUAL 0) MESSAGE(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}") ELSE() - STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1" - BISON_VERSION "${BISON_version_output}") + # Bison++ + IF("${BISON_version_output}" MATCHES "^bison\\+\\+") + STRING(REGEX REPLACE "^bison\\+\\+ Version ([^,]+).*" "\\1" + BISON_VERSION "${BISON_version_output}") + # GNU Bison + ELSEIF("${BISON_version_output}" MATCHES "^bison[^+]") + STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1" + BISON_VERSION "${BISON_version_output}") + ELSE() + SET(BISON_VERSION "unknown") + ENDIF() ENDIF() # internal macro diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake index 0f11234..c44adb4 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -1,5 +1,5 @@ # - Find GNU gettext tools -# This module looks for the GNU gettext tools. This module defines the +# This module looks for the GNU gettext tools. This module defines the # following values: # GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool. # GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool. @@ -7,8 +7,8 @@ # # Additionally it provides the following macros: # GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN ) -# This will create a target "translations" which will convert the -# given input po files into the binary output mo file. If the +# This will create a target "translations" which will convert the +# given input po files into the binary output mo file. If the # ALL option is used, the translations will also be created when # building the default target. # GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <destdir>] LANGUAGES <lang1> <lang2> ... ) @@ -52,7 +52,8 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg) SET(_firstPoFile "${_firstPoFileArg}") SET(_gmoFiles) - GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE) + GET_FILENAME_COMPONENT(_potName ${_potFile} NAME) + STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName}) GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE) SET(_addToAll) @@ -92,7 +93,8 @@ FUNCTION(GETTEXT_PROCESS_POT_FILE _potFile) CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) - GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE) + GET_FILENAME_COMPONENT(_potName ${_potFile} NAME) + STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName}) GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE) FOREACH (_lang ${_parsedArguments_LANGUAGES}) @@ -134,7 +136,8 @@ FUNCTION(GETTEXT_PROCESS_PO_FILES _lang) CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) FOREACH(_current_PO_FILE ${_parsedArguments_PO_FILES}) - GET_FILENAME_COMPONENT(_basename ${_current_PO_FILE} NAME_WE) + GET_FILENAME_COMPONENT(_name ${_current_PO_FILE} NAME) + STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name}) SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo) ADD_CUSTOM_COMMAND(OUTPUT ${_gmoFile} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE} diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index f607dc6..f616973 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -1,14 +1,18 @@ # - Find the native PNG includes and library # -# This module defines -# PNG_INCLUDE_DIR, where to find png.h, etc. +# This module searches libpng, the library for working with PNG images. +# +# It defines the following variables +# PNG_INCLUDE_DIRS, where to find png.h, etc. # PNG_LIBRARIES, the libraries to link against to use PNG. # PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files. # PNG_FOUND, If false, do not try to use PNG. -# also defined, but not for general use are +# Also defined, but not for general use are # PNG_LIBRARY, where to find the PNG library. -# None of the above will be defined unles zlib can be found. -# PNG depends on Zlib +# For backward compatiblity the variable PNG_INCLUDE_DIR is also set. It has the same value as PNG_INCLUDE_DIRS. +# +# Since PNG depends on the ZLib compression library, none of the above will be +# defined unless ZLib can be found. #============================================================================= # Copyright 2002-2009 Kitware, Inc. @@ -38,7 +42,8 @@ if(ZLIB_FOUND) if (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR) # png.h includes zlib.h. Sigh. - SET(PNG_INCLUDE_DIR ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ) + SET(PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ) + SET(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIRS} ) # for backward compatiblity SET(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY}) if (CYGWIN) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 7bb8b27..14055a4 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1441,6 +1441,43 @@ int cmCTest::RunTest(std::vector<const char*> argv, } //---------------------------------------------------------------------- +std::string cmCTest::SafeBuildIdField(const std::string& value) +{ + std::string safevalue(value); + + if (safevalue != "") + { + // Disallow non-filename and non-space whitespace characters. + // If they occur, replace them with "" + // + const char *disallowed = "\\/:*?\"<>|\n\r\t\f\v"; + + if (safevalue.find_first_of(disallowed) != value.npos) + { + std::string::size_type i = 0; + std::string::size_type n = strlen(disallowed); + char replace[2]; + replace[1] = 0; + + for (i= 0; i<n; ++i) + { + replace[0] = disallowed[i]; + cmSystemTools::ReplaceString(safevalue, replace, ""); + } + } + + safevalue = cmXMLSafe(safevalue).str(); + } + + if (safevalue == "") + { + safevalue = "(empty)"; + } + + return safevalue; +} + +//---------------------------------------------------------------------- void cmCTest::StartXML(std::ostream& ostr, bool append) { if(this->CurrentTag.empty()) @@ -1450,19 +1487,27 @@ void cmCTest::StartXML(std::ostream& ostr, bool append) " NightlStartTime was not set correctly." << std::endl); cmSystemTools::SetFatalErrorOccured(); } + // find out about the system cmsys::SystemInformation info; info.RunCPUCheck(); info.RunOSCheck(); info.RunMemoryCheck(); + + std::string buildname = cmCTest::SafeBuildIdField( + this->GetCTestConfiguration("BuildName")); + std::string stamp = cmCTest::SafeBuildIdField( + this->CurrentTag + "-" + this->GetTestModelString()); + std::string site = cmCTest::SafeBuildIdField( + this->GetCTestConfiguration("Site")); + ostr << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" - << "<Site BuildName=\"" << this->GetCTestConfiguration("BuildName") - << "\"\n\tBuildStamp=\"" << this->CurrentTag << "-" - << this->GetTestModelString() << "\"\n\tName=\"" - << this->GetCTestConfiguration("Site") << "\"\n\tGenerator=\"ctest-" - << cmVersion::GetCMakeVersion() << "\"\n" + << "<Site BuildName=\"" << buildname << "\"\n" + << "\tBuildStamp=\"" << stamp << "\"\n" + << "\tName=\"" << site << "\"\n" + << "\tGenerator=\"ctest-" << cmVersion::GetCMakeVersion() << "\"\n" << (append? "\tAppend=\"true\"\n":"") - << "\tCompilerName=\"" << this->GetCTestConfiguration("Compiler") + << "\tCompilerName=\"" << this->GetCTestConfiguration("Compiler") << "\"\n" #ifdef _COMPILER_VERSION << "\tCompilerVersion=\"_COMPILER_VERSION\"\n" diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 44a5349..7c71b00 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -259,6 +259,10 @@ public: std::string* stdOut, std::string* stdErr, int* retVal = 0, const char* dir = 0, double timeout = 0.0); + //! Clean/make safe for xml the given value such that it may be used as + // one of the key fields by CDash when computing the buildid. + static std::string SafeBuildIdField(const std::string& value); + //! Start CTest XML output file void StartXML(std::ostream& ostr, bool append); diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index 4d16409..de1ac30 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -250,6 +250,20 @@ cmLocalVisualStudioGenerator // Add this command line. std::string cmd = ccg.GetCommand(c); + + // Use "call " before any invocations of .bat or .cmd files + // invoked as custom commands. + // + std::string suffix; + if (cmd.size() > 4) + { + suffix = cmSystemTools::LowerCase(cmd.substr(cmd.size()-4)); + if (suffix == ".bat" || suffix == ".cmd") + { + script += "call "; + } + } + script += this->Convert(cmd.c_str(), relativeRoot, SHELL); ccg.AppendArguments(c, script); diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index c9e53f6..1df5ca9 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 11) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 18) +SET(KWSYS_DATE_STAMP_DAY 22) |