diff options
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 15 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/CTestTestMemcheck/memtester.cxx.in | 10 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/File_Generate/RunCMakeTest.cmake | 4 | ||||
-rwxr-xr-x | Utilities/Sphinx/create_identifiers.py | 28 |
7 files changed, 44 insertions, 20 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index eb5dd2e..b0a7f64 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 0) -set(CMake_VERSION_PATCH 20140717) +set(CMake_VERSION_PATCH 20140718) #set(CMake_VERSION_RC 1) diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 7c72cba..109905c 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -225,8 +225,8 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, std::string upload_as = url + "/" + remoteprefix + cmSystemTools::GetFilenameName(*file); - struct stat st; - if ( ::stat(local_file.c_str(), &st) ) + + if ( !cmSystemTools::FileExists(local_file.c_str()) ) { cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot find file: " << local_file << std::endl); @@ -234,6 +234,7 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, ::curl_global_cleanup(); return false; } + unsigned long filelen = cmSystemTools::FileLength(local_file.c_str()); ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); *this->LogFile << "\tUpload file: " << local_file << " to " @@ -252,7 +253,7 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, // and give the size of the upload (optional) ::curl_easy_setopt(curl, CURLOPT_INFILESIZE, - static_cast<long>(st.st_size)); + static_cast<long>(filelen)); // and give curl the buffer for errors ::curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &error_buffer); @@ -466,8 +467,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, upload_as += md5; } - struct stat st; - if ( ::stat(local_file.c_str(), &st) ) + if( !cmSystemTools::FileExists(local_file.c_str()) ) { cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot find file: " << local_file << std::endl); @@ -475,11 +475,12 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, ::curl_global_cleanup(); return false; } + unsigned long filelen = cmSystemTools::FileLength(local_file.c_str()); ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: " << local_file << " to " - << upload_as << " Size: " << st.st_size << std::endl); + << upload_as << " Size: " << filelen << std::endl); // specify target ::curl_easy_setopt(curl,CURLOPT_URL, upload_as.c_str()); @@ -489,7 +490,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, // and give the size of the upload (optional) ::curl_easy_setopt(curl, CURLOPT_INFILESIZE, - static_cast<long>(st.st_size)); + static_cast<long>(filelen)); // and give curl the buffer for errors ::curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &error_buffer); diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index dc4f894..ca7fcdc 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -77,7 +77,7 @@ if(BUILD_TESTING) # some old versions of make simply cannot handle spaces in paths if (MAKE_IS_GNU OR CMAKE_MAKE_PROGRAM MATCHES "nmake|gmake|wmake" OR - CMAKE_GENERATOR MATCHES "Visual Studio|XCode|Borland") + CMAKE_GENERATOR MATCHES "Visual Studio|Xcode|Borland") set(MAKE_SUPPORTS_SPACES 1) else() set(MAKE_SUPPORTS_SPACES 0) @@ -1502,7 +1502,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release ) endif() - if(MAKE_SUPPORTS_SPACES) + if(MAKE_SUPPORTS_SPACES AND NOT CMAKE_GENERATOR STREQUAL "Xcode") add_test(SubDirSpaces ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubDirSpaces" diff --git a/Tests/CTestTestMemcheck/memtester.cxx.in b/Tests/CTestTestMemcheck/memtester.cxx.in index 55a34e3..43c0ba7 100644 --- a/Tests/CTestTestMemcheck/memtester.cxx.in +++ b/Tests/CTestTestMemcheck/memtester.cxx.in @@ -1,11 +1,19 @@ #include <cmSystemTools.h> +#include <cmsys/Encoding.hxx> #include <string> +#include <locale.h> #define RETVAL @_retval@ int -main(int argc, char **argv) +main(int ac, char **av) { + setlocale(LC_CTYPE, ""); + cmsys::Encoding::CommandLineArguments args = + cmsys::Encoding::CommandLineArguments::Main(ac, av); + int argc = args.argc(); + const char* const* argv = args.argv(); + std::string exename = argv[0]; std::string logarg; bool nextarg = false; diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 06272ce..ff3b9a0 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -18,6 +18,7 @@ endif() if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 2) set(TargetSources_ARGS -DXCODE_BELOW_2=1) + set(File_Generate_ARGS -DXCODE_BELOW_2=1) endif() add_RunCMake_test(CMP0019) diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake index f74d17e..dee0692 100644 --- a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake +++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake @@ -1,8 +1,8 @@ include(RunCMake) run_cmake(CommandConflict) -if("${RunCMake_GENERATOR}" MATCHES "Visual Studio" OR "${RunCMake_GENERATOR}" MATCHES "XCode" ) - run_cmake(OutputConflict) +if("${RunCMake_GENERATOR}" MATCHES "Visual Studio|Xcode" AND NOT XCODE_BELOW_2) + run_cmake(OutputConflict) endif() run_cmake(EmptyCondition1) run_cmake(EmptyCondition2) diff --git a/Utilities/Sphinx/create_identifiers.py b/Utilities/Sphinx/create_identifiers.py index 4db7a3f..7715e53 100755 --- a/Utilities/Sphinx/create_identifiers.py +++ b/Utilities/Sphinx/create_identifiers.py @@ -19,13 +19,27 @@ if not lines: newlines = [] for line in lines: - if "<keyword name=\"command\"" in line: - if not "id=\"" in line: - prefix = "<keyword name=\"command\" " - part1, part2 = line.split(prefix) - head, tail = part2.split("#command:") - cmdname, rest = tail.split("\"") - line = part1 + prefix + "id=\"command/" + cmdname + "\" " + part2 + + mapping = (("command", "command"), + ("variable", "variable"), + ("target property", "prop_tgt"), + ("test property", "prop_test"), + ("source file property", "prop_sf"), + ("global property", "prop_gbl"), + ("module", "module"), + ("directory property", "prop_dir"), + ("cache property", "prop_cache"), + ("policy", "policy"), + ("installed file property", "prop_inst")) + + for domain_object_string, domain_object_type in mapping: + if "<keyword name=\"" + domain_object_string + "\"" in line: + if not "id=\"" in line: + prefix = "<keyword name=\"" + domain_object_string + "\" " + part1, part2 = line.split(prefix) + head, tail = part2.split("#" + domain_object_type + ":") + domain_object, rest = tail.split("\"") + line = part1 + prefix + "id=\"" + domain_object_type + "/" + domain_object + "\" " + part2 newlines.append(line + "\n") f = open(name, "w") |