summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake3
-rw-r--r--Modules/Compiler/CrayPrgEnv.cmake7
-rw-r--r--Source/CMakeInstallDestinations.cmake5
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/QtDialog/CMakeLists.txt6
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx31
-rw-r--r--Source/cmGlobalXCodeGenerator.h1
-rw-r--r--Source/cmXCodeObject.cxx4
-rw-r--r--Tests/Module/GenerateExportHeader/exportheader_test.cpp12
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape-check.cmake7
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape.cmake3
-rwxr-xr-xbootstrap7
13 files changed, 55 insertions, 34 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index eb54814..feae1c4 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -183,9 +183,6 @@ Id flags: ${testflags}
set(v 6)
set(ext dsp)
endif()
- if("${id_platform}" STREQUAL "Itanium")
- set(id_platform ia64)
- endif()
if(CMAKE_VS_PLATFORM_TOOLSET)
if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
set(id_toolset "<NdkToolchainVersion>${CMAKE_VS_PLATFORM_TOOLSET}</NdkToolchainVersion>")
diff --git a/Modules/Compiler/CrayPrgEnv.cmake b/Modules/Compiler/CrayPrgEnv.cmake
index 61daa0f..fa39b00 100644
--- a/Modules/Compiler/CrayPrgEnv.cmake
+++ b/Modules/Compiler/CrayPrgEnv.cmake
@@ -16,13 +16,16 @@ macro(__cray_extract_args cmd tag_regex out_var make_absolute)
endmacro()
function(__cray_extract_implicit src compiler_cmd link_cmd lang include_dirs_var link_dirs_var link_libs_var)
+ set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CrayExtractImplicit_${lang}.bin")
execute_process(
- COMMAND ${CMAKE_${lang}_COMPILER}
- ${CMAKE_${lang}_VERBOSE_FLAG} -o cray_extract_implicit_${lang} ${src}
+ COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_VERBOSE_FLAG} -o ${BIN}
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE error
)
+ if(EXISTS "${BIN}")
+ file(REMOVE "${BIN}")
+ endif()
set(include_dirs)
set(link_dirs)
set(link_libs)
diff --git a/Source/CMakeInstallDestinations.cmake b/Source/CMakeInstallDestinations.cmake
index 99c86ca..2f9d95a 100644
--- a/Source/CMakeInstallDestinations.cmake
+++ b/Source/CMakeInstallDestinations.cmake
@@ -3,24 +3,29 @@ if(BEOS)
set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # HAIKU
set(CMAKE_MAN_DIR_DEFAULT "documentation/man") # HAIKU
set(CMAKE_DOC_DIR_DEFAULT "documentation/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # HAIKU
+ set(CMAKE_XDGDATA_DIR_DEFAULT "share") # HAIKU
elseif(CYGWIN)
set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION}") # CYGWIN
set(CMAKE_DOC_DIR_DEFAULT "share/doc/cmake-${CMake_VERSION}") # CYGWIN
set(CMAKE_MAN_DIR_DEFAULT "share/man") # CYGWIN
+ set(CMAKE_XDGDATA_DIR_DEFAULT "share") # CYGWIN
else()
set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # OTHER
set(CMAKE_DOC_DIR_DEFAULT "doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # OTHER
set(CMAKE_MAN_DIR_DEFAULT "man") # OTHER
+ set(CMAKE_XDGDATA_DIR_DEFAULT "share") # OTHER
endif()
set(CMAKE_DATA_DIR_DESC "data")
set(CMAKE_DOC_DIR_DESC "docs")
set(CMAKE_MAN_DIR_DESC "man pages")
+set(CMAKE_XDGDATA_DIR_DESC "XDG specific files")
foreach(v
CMAKE_DATA_DIR
CMAKE_DOC_DIR
CMAKE_MAN_DIR
+ CMAKE_XDGDATA_DIR
)
# Populate the cache with empty values so we know when the user sets them.
set(${v} "" CACHE STRING "")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 4cd8c80..cf87759 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 4)
-set(CMake_VERSION_PATCH 20160103)
+set(CMake_VERSION_PATCH 20160107)
#set(CMake_VERSION_RC 1)
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 9161ad3..f17de5d 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -193,7 +193,7 @@ if(UNIX AND NOT APPLE)
foreach (size IN ITEMS 32 128)
install(
FILES "${CMAKE_CURRENT_SOURCE_DIR}/CMakeSetup${size}.png"
- DESTINATION "share/icons/hicolor/${size}x${size}/apps"
+ DESTINATION "${CMAKE_XDGDATA_DIR}/icons/hicolor/${size}x${size}/apps"
${COMPONENT}
RENAME "CMakeSetup.png")
endforeach ()
@@ -201,10 +201,10 @@ if(UNIX AND NOT APPLE)
# install a desktop file so CMake appears in the application start menu
# with an icon
install(FILES CMake.desktop
- DESTINATION share/applications
+ DESTINATION "${CMAKE_XDGDATA_DIR}/applications"
${COMPONENT})
install(FILES cmakecache.xml
- DESTINATION share/mime/packages
+ DESTINATION "${CMAKE_XDGDATA_DIR}/mime/packages"
${COMPONENT})
endif()
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index fa9af12..526e32f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1735,14 +1735,13 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
}
std::string cdir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
- cdir = this->ConvertToRelativeForXCode(cdir.c_str());
+ cdir = this->ConvertToRelativeForMake(cdir.c_str());
std::string makecmd = "make -C ";
makecmd += cdir;
makecmd += " -f ";
makecmd += this->ConvertToRelativeForMake(
(makefile+"$CONFIGURATION").c_str());
makecmd += " all";
- cmSystemTools::ReplaceString(makecmd, "\\ ", "\\\\ ");
buildphase->AddAttribute("shellScript",
this->CreateString(makecmd.c_str()));
buildphase->AddAttribute("showEnvVarsInLog",
@@ -2157,10 +2156,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
this->CurrentLocalGenerator
->GenerateAppleInfoPList(gtgt, "$(EXECUTABLE_NAME)",
plist.c_str());
- std::string path =
- this->ConvertToRelativeForXCode(plist.c_str());
buildSettings->AddAttribute("INFOPLIST_FILE",
- this->CreateString(path.c_str()));
+ this->CreateString(plist));
}
else if(this->XcodeVersion >= 22)
{
@@ -2206,10 +2203,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
this->CurrentLocalGenerator
->GenerateFrameworkInfoPList(gtgt, "$(EXECUTABLE_NAME)",
plist.c_str());
- std::string path =
- this->ConvertToRelativeForXCode(plist.c_str());
buildSettings->AddAttribute("INFOPLIST_FILE",
- this->CreateString(path.c_str()));
+ this->CreateString(plist));
}
else
{
@@ -2249,10 +2244,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
this->CurrentLocalGenerator
->GenerateAppleInfoPList(gtgt, "$(EXECUTABLE_NAME)",
plist.c_str());
- std::string path =
- this->ConvertToRelativeForXCode(plist.c_str());
buildSettings->AddAttribute("INFOPLIST_FILE",
- this->CreateString(path.c_str()));
+ this->CreateString(plist));
}
}
@@ -3911,12 +3904,6 @@ std::string cmGlobalXCodeGenerator::ConvertToRelativeForMake(const char* p)
}
//----------------------------------------------------------------------------
-std::string cmGlobalXCodeGenerator::ConvertToRelativeForXCode(const char* p)
-{
- return cmSystemTools::ConvertToOutputPath(p);
-}
-
-//----------------------------------------------------------------------------
std::string cmGlobalXCodeGenerator::RelativeToSource(const char* p)
{
// We force conversion because Xcode breakpoints do not work unless
@@ -4052,8 +4039,8 @@ void cmGlobalXCodeGenerator::AppendFlag(std::string& flags,
// We escape a flag as follows:
// - Place each flag in single quotes ''
- // - Escape a single quote as \\'
- // - Escape a backslash as \\\\ since it itself is an escape
+ // - Escape a single quote as \'
+ // - Escape a backslash as \\ since it itself is an escape
// Note that in the code below we need one more level of escapes for
// C string syntax in this source file.
//
@@ -4073,16 +4060,16 @@ void cmGlobalXCodeGenerator::AppendFlag(std::string& flags,
{
if (this->XcodeVersion >= 40)
{
- flags += "'\\\\''";
+ flags += "'\\''";
}
else
{
- flags += "\\\\'";
+ flags += "\\'";
}
}
else if(*c == '\\')
{
- flags += "\\\\\\\\";
+ flags += "\\\\";
}
else
{
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 9659822..862746f 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -99,7 +99,6 @@ private:
std::string XCodeEscapePath(const char* p);
std::string RelativeToSource(const char* p);
std::string RelativeToBinary(const char* p);
- std::string ConvertToRelativeForXCode(const char* p);
std::string ConvertToRelativeForMake(const char* p);
void CreateCustomCommands(cmXCodeObject* buildPhases,
cmXCodeObject* sourceBuildPhase,
diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx
index c59c360..5bc34c1 100644
--- a/Source/cmXCodeObject.cxx
+++ b/Source/cmXCodeObject.cxx
@@ -255,9 +255,9 @@ void cmXCodeObject::PrintString(std::ostream& os,std::string String)
for(std::string::const_iterator i = String.begin();
i != String.end(); ++i)
{
- if(*i == '"')
+ if(*i == '"' || *i == '\\')
{
- // Escape double-quotes.
+ // Escape double-quotes and backslashes.
os << '\\';
}
os << *i;
diff --git a/Tests/Module/GenerateExportHeader/exportheader_test.cpp b/Tests/Module/GenerateExportHeader/exportheader_test.cpp
index 146374a..4f45f37 100644
--- a/Tests/Module/GenerateExportHeader/exportheader_test.cpp
+++ b/Tests/Module/GenerateExportHeader/exportheader_test.cpp
@@ -39,6 +39,18 @@ void compare(const char* refName, const char* testName)
std::string testLine;
std::getline(ref, refLine);
std::getline(test, testLine);
+ // Some very old Borland runtimes (C++ Builder 5 WITHOUT Update 1) add a
+ // trailing null to the string that we need to strip before testing for a
+ // trailing space.
+ if (refLine.size() && refLine[refLine.size()-1] == 0)
+ {
+ refLine = refLine.substr(0, refLine.size() - 1);
+ }
+ if (testLine.size() && testLine[testLine.size()-1] == 0)
+ {
+ testLine = testLine.substr(0, testLine.size() - 1);
+ }
+ // The reference files never have trailing spaces:
if (testLine.size() && testLine[testLine.size()-1] == ' ')
{
testLine = testLine.substr(0, testLine.size() - 1);
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index acc0075..395c74b 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -3,6 +3,7 @@ include(RunCMake)
run_cmake(XcodeFileType)
run_cmake(XcodeAttributeGenex)
run_cmake(XcodeAttributeGenexError)
+run_cmake(XcodeObjectNeedsEscape)
run_cmake(XcodeObjectNeedsQuote)
run_cmake(XcodeOptimizationFlags)
run_cmake(XcodePreserveNonOptimizationFlags)
diff --git a/Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape-check.cmake b/Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape-check.cmake
new file mode 100644
index 0000000..c34e3fe
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape-check.cmake
@@ -0,0 +1,7 @@
+set(expect "-DKDESRCDIR=\\\\\\\\\\\\\"foo\\\\\\\\\\\\\"")
+file(STRINGS ${RunCMake_TEST_BINARY_DIR}/XcodeObjectNeedsEscape.xcodeproj/project.pbxproj actual
+ REGEX "OTHER_CPLUSPLUSFLAGS = [^;]*;" LIMIT_COUNT 1)
+if(NOT "${actual}" MATCHES "${expect}")
+ message(SEND_ERROR "The actual project contains the line:\n ${actual}\n"
+ "which does not match expected regex:\n ${expect}\n")
+endif()
diff --git a/Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape.cmake b/Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape.cmake
new file mode 100644
index 0000000..7606a19
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeObjectNeedsEscape.cmake
@@ -0,0 +1,3 @@
+enable_language(CXX)
+string(APPEND CMAKE_CXX_FLAGS " -DKDESRCDIR=\\\"foo\\\"")
+add_library(foo STATIC foo.cpp)
diff --git a/bootstrap b/bootstrap
index 9e30363..d1274c1 100755
--- a/bootstrap
+++ b/bootstrap
@@ -63,9 +63,11 @@ cmake_copyright="`grep '^Copyright .* Kitware' "${cmake_source_dir}/Copyright.tx
cmake_data_dir_keyword="OTHER"
cmake_doc_dir_keyword="OTHER"
cmake_man_dir_keyword="OTHER"
+cmake_xdgdata_dir_keyword="OTHER"
cmake_data_dir=""
cmake_doc_dir=""
cmake_man_dir=""
+cmake_xdgdata_dir=""
cmake_init_file=""
cmake_bootstrap_system_libs=""
cmake_bootstrap_qt_gui=""
@@ -214,6 +216,7 @@ fi
cmake_data_dir_default="`cmake_install_dest_default DATA ${cmake_data_dir_keyword}`"
cmake_doc_dir_default="`cmake_install_dest_default DOC ${cmake_doc_dir_keyword}`"
cmake_man_dir_default="`cmake_install_dest_default MAN ${cmake_man_dir_keyword}`"
+cmake_xdgdata_dir_default="`cmake_install_dest_default XDGDATA ${cmake_xdgdata_dir_keyword}`"
CMAKE_KNOWN_C_COMPILERS="cc gcc xlc icc tcc"
CMAKE_KNOWN_CXX_COMPILERS="aCC xlC CC g++ c++ icc como "
@@ -423,6 +426,8 @@ Directory and file names:
['"${cmake_doc_dir_default}"']
--mandir=DIR install man pages files in PREFIX/DIR/manN
['"${cmake_man_dir_default}"']
+ --xdgdatadir=DIR install XDG specific files in PREFIX/DIR
+ ['"${cmake_xdgdata_dir_default}"']
'
exit 10
}
@@ -623,6 +628,7 @@ while test $# != 0; do
--datadir=*) cmake_data_dir=`cmake_arg "$1"` ;;
--docdir=*) cmake_doc_dir=`cmake_arg "$1"` ;;
--mandir=*) cmake_man_dir=`cmake_arg "$1"` ;;
+ --xdgdatadir=*) cmake_xdgdata_dir=`cmake_arg "$1"` ;;
--init=*) cmake_init_file=`cmake_arg "$1"` ;;
--system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=1" ;;
--no-system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=0" ;;
@@ -1367,6 +1373,7 @@ set (CMAKE_INSTALL_PREFIX "'"${cmake_prefix_dir}"'" CACHE PATH "Install path pre
set (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
set (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)
set (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE)
+set (CMAKE_XDGDATA_DIR "'"${cmake_xdgdata_dir}"'" CACHE PATH "Install location for XDG specific files (relative to prefix)." FORCE)
' > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
# Add configuration settings given as command-line options.