mirror of
https://github.com/reactos/CMake.git
synced 2024-11-29 06:20:23 +00:00
ENH: Merge from cpack branch
This commit is contained in:
parent
a11b9a4cdc
commit
8477aa59e5
@ -7,6 +7,10 @@ CONFIGURE_FILE(
|
||||
"${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in"
|
||||
"${CMake_BINARY_DIR}/Source/cmConfigure.h"
|
||||
)
|
||||
CONFIGURE_FILE(
|
||||
"${CMake_SOURCE_DIR}/Source/CPack/cmCPackConfigure.h.in"
|
||||
"${CMake_BINARY_DIR}/Source/CPack/cmCPackConfigure.h"
|
||||
)
|
||||
|
||||
# add the include path to find the .h
|
||||
INCLUDE_DIRECTORIES(
|
||||
@ -247,6 +251,21 @@ SET(CMTEST_SRCS cmCTest.cxx
|
||||
ADD_LIBRARY(CTestLib ${CMTEST_SRCS})
|
||||
TARGET_LINK_LIBRARIES(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
|
||||
|
||||
#
|
||||
# Sources for CPack
|
||||
#
|
||||
SET(CPACK_SRCS
|
||||
CPack/cmCPackGenerators.cxx
|
||||
CPack/cmCPackSTGZGenerator.cxx
|
||||
CPack/cmCPackTGZGenerator.cxx
|
||||
CPack/cmCPackNSISGenerator.cxx
|
||||
CPack/cmCPackPackageMakerGenerator.cxx
|
||||
CPack/cmCPackGenericGenerator.cxx
|
||||
)
|
||||
# Build CPackLib
|
||||
ADD_LIBRARY(CPackLib ${CPACK_SRCS})
|
||||
TARGET_LINK_LIBRARIES(CPackLib CMakeLib)
|
||||
|
||||
# Build CMake executable
|
||||
ADD_EXECUTABLE(cmake cmakemain.cxx)
|
||||
TARGET_LINK_LIBRARIES(cmake CMakeLib)
|
||||
@ -265,6 +284,10 @@ ENDIF(WIN32)
|
||||
ADD_EXECUTABLE(ctest ctest.cxx)
|
||||
TARGET_LINK_LIBRARIES(ctest CTestLib)
|
||||
|
||||
# Build CPack executable
|
||||
ADD_EXECUTABLE(cpack CPack/cpack.cxx)
|
||||
TARGET_LINK_LIBRARIES(cpack CPackLib)
|
||||
|
||||
# Curses GUI
|
||||
IF (UNIX)
|
||||
INCLUDE (${CMake_SOURCE_DIR}/Modules/FindCurses.cmake OPTIONAL)
|
||||
|
@ -1353,6 +1353,51 @@ bool cmSystemTools::PutEnv(const char* value)
|
||||
return ret == 0;
|
||||
}
|
||||
|
||||
std::string cmSystemTools::MakeXMLSafe(const char* str)
|
||||
{
|
||||
std::vector<char> result;
|
||||
result.reserve(500);
|
||||
const char* pos = str;
|
||||
for ( ;*pos; ++pos)
|
||||
{
|
||||
char ch = *pos;
|
||||
if ( (ch > 126 || ch < 32) && ch != 9 && ch != 10 && ch != 13 && ch != '\r' )
|
||||
{
|
||||
char buffer[33];
|
||||
sprintf(buffer, "<%d>", (int)ch);
|
||||
//sprintf(buffer, "&#x%0x;", (unsigned int)ch);
|
||||
result.insert(result.end(), buffer, buffer+strlen(buffer));
|
||||
}
|
||||
else
|
||||
{
|
||||
const char* const encodedChars[] = {
|
||||
"&",
|
||||
"<",
|
||||
">"
|
||||
};
|
||||
switch ( ch )
|
||||
{
|
||||
case '&':
|
||||
result.insert(result.end(), encodedChars[0], encodedChars[0]+5);
|
||||
break;
|
||||
case '<':
|
||||
result.insert(result.end(), encodedChars[1], encodedChars[1]+4);
|
||||
break;
|
||||
case '>':
|
||||
result.insert(result.end(), encodedChars[2], encodedChars[2]+4);
|
||||
break;
|
||||
case '\n':
|
||||
result.push_back('\n');
|
||||
break;
|
||||
case '\r': break; // Ignore \r
|
||||
default:
|
||||
result.push_back(ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
return std::string(&*result.begin(), result.size());
|
||||
}
|
||||
|
||||
bool cmSystemTools::IsPathToFramework(const char* path)
|
||||
{
|
||||
if(cmSystemTools::FileIsFullPath(path))
|
||||
|
@ -297,6 +297,9 @@ public:
|
||||
of the form var=value */
|
||||
static bool PutEnv(const char* value);
|
||||
|
||||
/** Make string XML safe */
|
||||
static std::string MakeXMLSafe(const char* str);
|
||||
|
||||
/** Create tar */
|
||||
static bool ListTar(const char* outFileName, std::vector<cmStdString>& files, bool gzip, bool verbose);
|
||||
static bool CreateTar(const char* outFileName, const std::vector<cmStdString>& files, bool gzip, bool verbose);
|
||||
|
Loading…
Reference in New Issue
Block a user