diff options
26 files changed, 255 insertions, 125 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index ca9649a..21dadd9 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -188,7 +188,7 @@ if (MPI_INCLUDE_PATH AND MPI_LIBRARY) # the cache, and we don't want to override those settings. elseif (MPI_COMPILE_CMDLINE) # Extract compile flags from the compile command line. - string(REGEX MATCHALL "-D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}") + string(REGEX MATCHALL "(^| )-D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}") set(MPI_COMPILE_FLAGS_WORK) foreach(FLAG ${MPI_ALL_COMPILE_FLAGS}) if (MPI_COMPILE_FLAGS_WORK) @@ -199,10 +199,10 @@ elseif (MPI_COMPILE_CMDLINE) endforeach(FLAG) # Extract include paths from compile command line - string(REGEX MATCHALL "-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") + string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") set(MPI_INCLUDE_PATH_WORK) foreach(IPATH ${MPI_ALL_INCLUDE_PATHS}) - string(REGEX REPLACE "^-I" "" IPATH ${IPATH}) + string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH}) string(REGEX REPLACE "//" "/" IPATH ${IPATH}) list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH}) endforeach(IPATH) @@ -230,10 +230,10 @@ elseif (MPI_COMPILE_CMDLINE) endif (NOT MPI_INCLUDE_PATH_WORK) # Extract linker paths from the link command line - string(REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") + string(REGEX MATCHALL "(^| |-Wl,)-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") set(MPI_LINK_PATH) foreach(LPATH ${MPI_ALL_LINK_PATHS}) - string(REGEX REPLACE "^-L" "" LPATH ${LPATH}) + string(REGEX REPLACE "^(| |-Wl,)-L" "" LPATH ${LPATH}) string(REGEX REPLACE "//" "/" LPATH ${LPATH}) list(APPEND MPI_LINK_PATH ${LPATH}) endforeach(LPATH) @@ -251,7 +251,7 @@ elseif (MPI_COMPILE_CMDLINE) endif (NOT MPI_LINK_PATH) # Extract linker flags from the link command line - string(REGEX MATCHALL "-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") + string(REGEX MATCHALL "(^| )-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") set(MPI_LINK_FLAGS_WORK) foreach(FLAG ${MPI_ALL_LINK_FLAGS}) if (MPI_LINK_FLAGS_WORK) @@ -263,20 +263,20 @@ elseif (MPI_COMPILE_CMDLINE) # Extract the set of libraries to link against from the link command # line - string(REGEX MATCHALL "-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") + string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") # Determine full path names for all of the libraries that one needs # to link against in an MPI program set(MPI_LIBRARIES) foreach(LIB ${MPI_LIBNAMES}) - string(REGEX REPLACE "^-l" "" LIB ${LIB}) + string(REGEX REPLACE "^ ?-l" "" LIB ${LIB}) set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) find_library(MPI_LIB ${LIB} HINTS ${MPI_LINK_PATH}) if (MPI_LIB) list(APPEND MPI_LIBRARIES ${MPI_LIB}) - else (MPI_LIB) - message(SEND_ERROR "Unable to find MPI library ${LIB}") - endif (MPI_LIB) + elseif (NOT MPI_FIND_QUIETLY) + message(WARNING "Unable to find MPI library ${LIB}") + endif () endforeach(LIB) set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI detection" FORCE) diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index c254dbb..cee24ef 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -371,7 +371,7 @@ static const char * ar_rname(const char *path) typedef struct ar_hdr HDR; static char ar_hb[sizeof(HDR) + 1]; /* real header */ -static int ar_already_written; +static size_t ar_already_written; /* copy_ar -- * Copy size bytes from one file to another - taking care to handle the diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 4d39367..d50eaaa 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -18,6 +18,23 @@ #include <stack> #include <float.h> +class TestComparator +{ +public: + TestComparator(cmCTestMultiProcessHandler* handler) : Handler(handler) {} + ~TestComparator() {} + + // Sorts tests in descending order of cost + bool operator() (int index1, int index2) const + { + return Handler->Properties[index1]->Cost > + Handler->Properties[index2]->Cost; + } + +private: + cmCTestMultiProcessHandler* Handler; +}; + cmCTestMultiProcessHandler::cmCTestMultiProcessHandler() { this->ParallelLevel = 1; @@ -154,15 +171,8 @@ void cmCTestMultiProcessHandler::UnlockResources(int index) void cmCTestMultiProcessHandler::EraseTest(int test) { this->Tests.erase(test); - for(TestCostMap::iterator i = this->TestCosts.begin(); - i != this->TestCosts.end(); ++i) - { - if(i->second.find(test) != i->second.end()) - { - i->second.erase(test); - return; - } - } + this->SortedTests.erase( + std::find(this->SortedTests.begin(), this->SortedTests.end(), test)); } //--------------------------------------------------------- @@ -244,41 +254,36 @@ void cmCTestMultiProcessHandler::StartNextTests() return; } - for(TestCostMap::reverse_iterator i = this->TestCosts.rbegin(); - i != this->TestCosts.rend(); ++i) + TestList copy = this->SortedTests; + for(TestList::iterator test = copy.begin(); test != copy.end(); ++test) { - TestSet tests = i->second; //copy the test set - for(TestSet::iterator test = tests.begin(); - test != tests.end(); ++test) + //in case this test has already been started due to dependency + if(this->TestRunningMap[*test] || this->TestFinishMap[*test]) { - //in case this test has already been started due to dependency - if(this->TestRunningMap[*test] || this->TestFinishMap[*test]) - { - continue; - } - size_t processors = GetProcessorsUsed(*test); - if(processors > numToStart) - { - return; - } - if(this->StartTest(*test)) - { - if(this->StopTimePassed) - { - return; - } - numToStart -= processors; - } - else - { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl - << "Test did not start waiting on depends to finish: " - << *test << "\n"); - } - if(numToStart == 0) + continue; + } + size_t processors = GetProcessorsUsed(*test); + if(processors > numToStart) + { + return; + } + if(this->StartTest(*test)) + { + if(this->StopTimePassed) { return; } + numToStart -= processors; + } + else + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl + << "Test did not start waiting on depends to finish: " + << *test << "\n"); + } + if(numToStart == 0) + { + return; } } } @@ -468,27 +473,22 @@ void cmCTestMultiProcessHandler::CreateTestCostList() for(TestMap::iterator i = this->Tests.begin(); i != this->Tests.end(); ++i) { - //We only want to schedule them by cost in a parallel situation - if(this->ParallelLevel > 1) - { - std::string name = this->Properties[i->first]->Name; - if(std::find(this->LastTestsFailed.begin(), this->LastTestsFailed.end(), - name) != this->LastTestsFailed.end()) - { - this->TestCosts[FLT_MAX].insert(i->first); - } - else - { - this->TestCosts[this->Properties[i->first]->Cost].insert(i->first); - } - } - else //we ignore their cost + SortedTests.push_back(i->first); + + //If the test failed last time, it should be run first, so max the cost + if(std::find(this->LastTestsFailed.begin(), + this->LastTestsFailed.end(), + this->Properties[i->first]->Name) + != this->LastTestsFailed.end()) { - size_t index = this->Tests.size() - - static_cast<size_t>(this->Properties[i->first]->Index); - this->TestCosts[index].insert(i->first); + this->Properties[i->first]->Cost = FLT_MAX; } } + if(this->ParallelLevel > 1) + { + TestComparator comp(this); + std::sort(SortedTests.begin(), SortedTests.end(), comp); + } } //--------------------------------------------------------- @@ -611,7 +611,7 @@ int cmCTestMultiProcessHandler::FindMaxIndex() //Returns true if no cycles exist in the dependency graph bool cmCTestMultiProcessHandler::CheckCycles() { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Checking test dependency graph..." << std::endl); for(TestMap::iterator it = this->Tests.begin(); it != this->Tests.end(); ++it) @@ -619,34 +619,29 @@ bool cmCTestMultiProcessHandler::CheckCycles() //DFS from each element to itself std::stack<int> s; std::vector<int> visited; + s.push(it->first); - visited.push_back(it->first); while(!s.empty()) { int test = s.top(); s.pop(); - + for(TestSet::iterator d = this->Tests[test].begin(); d != this->Tests[test].end(); ++d) { - s.push(*d); - for(std::vector<int>::iterator v = visited.begin(); - v != visited.end(); ++v) + if(std::find(visited.begin(), visited.end(), *d) != visited.end()) { - if(*v == *d) - { - //cycle exists - cmCTestLog(this->CTest, ERROR_MESSAGE, "Error: a cycle exists in " - "the test dependency graph for the test \"" - << this->Properties[*d]->Name << "\"." << std::endl - << "Please fix the cycle and run ctest again." << std::endl); - return false; - } + //cycle exists + cmCTestLog(this->CTest, ERROR_MESSAGE, "Error: a cycle exists in " + "the test dependency graph for the test \"" + << this->Properties[it->first]->Name << "\"." << std::endl + << "Please fix the cycle and run ctest again." << std::endl); + return false; } - visited.push_back(*d); + s.push(*d); } - visited.pop_back(); + visited.push_back(test); } } return true; diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h index 4f51b0b..cc330f7 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.h +++ b/Source/CTest/cmCTestMultiProcessHandler.h @@ -23,10 +23,11 @@ */ class cmCTestMultiProcessHandler { + friend class TestComparator; public: struct TestSet : public std::set<int> {}; struct TestMap : public std::map<int, TestSet> {}; - struct TestCostMap : public std::map<float, TestSet> {}; + struct TestList : public std::vector<int> {}; struct PropertiesMap : public std::map<int, cmCTestTestHandler::cmCTestTestProperties*> {}; @@ -88,7 +89,7 @@ protected: void UnlockResources(int index); // map from test number to set of depend tests TestMap Tests; - TestCostMap TestCosts; + TestList SortedTests; //Total number of tests we'll be running size_t Total; //Number of tests that are complete diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index c66147b..1c48d8c 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -53,13 +53,13 @@ void cmCursesLongMessageForm::UpdateStatusBar() getmaxyx(stdscr, y, x); char bar[cmCursesMainForm::MAX_WIDTH]; - int size = strlen(this->Title.c_str()); + size_t size = strlen(this->Title.c_str()); if ( size >= cmCursesMainForm::MAX_WIDTH ) { size = cmCursesMainForm::MAX_WIDTH-1; } strncpy(bar, this->Title.c_str(), size); - for(int i=size-1; i<cmCursesMainForm::MAX_WIDTH; i++) bar[i] = ' '; + for(size_t i=size-1; i<cmCursesMainForm::MAX_WIDTH; i++) bar[i] = ' '; int width; if (x < cmCursesMainForm::MAX_WIDTH ) @@ -76,8 +76,8 @@ void cmCursesLongMessageForm::UpdateStatusBar() char version[cmCursesMainForm::MAX_WIDTH]; char vertmp[128]; sprintf(vertmp,"CMake Version %s", cmVersion::GetCMakeVersion()); - int sideSpace = (width-strlen(vertmp)); - for(int i=0; i<sideSpace; i++) { version[i] = ' '; } + size_t sideSpace = (width-strlen(vertmp)); + for(size_t i=0; i<sideSpace; i++) { version[i] = ' '; } sprintf(version+sideSpace, "%s", vertmp); version[width] = '\0'; diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index cd231ad..389ec7f 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -242,7 +242,7 @@ void cmCursesMainForm::RePost() // Assign the fields: 3 for each entry: label, new entry marker // ('*' or ' ') and entry widget this->Fields = new FIELD*[3*this->NumberOfVisibleEntries+1]; - int cc; + size_t cc; for ( cc = 0; cc < 3 * this->NumberOfVisibleEntries+1; cc ++ ) { this->Fields[cc] = 0; @@ -454,7 +454,7 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */) if (cw) { sprintf(firstLine, "Page %d of %d", cw->GetPage(), this->NumberOfPages); - curses_move(0,65-strlen(firstLine)-1); + curses_move(0,65-static_cast<unsigned int>(strlen(firstLine))-1); printw(firstLine); } // } @@ -526,10 +526,10 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) // Join the key, help string and pad with spaces // (or truncate) as necessary char bar[cmCursesMainForm::MAX_WIDTH]; - int i, curFieldLen = strlen(curField); - int helpLen = strlen(help); + size_t i, curFieldLen = strlen(curField); + size_t helpLen = strlen(help); - int width; + size_t width; if (x < cmCursesMainForm::MAX_WIDTH ) { width = x; @@ -592,7 +592,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) char version[cmCursesMainForm::MAX_WIDTH]; char vertmp[128]; sprintf(vertmp,"CMake Version %s", cmVersion::GetCMakeVersion()); - int sideSpace = (width-strlen(vertmp)); + size_t sideSpace = (width-strlen(vertmp)); for(i=0; i<sideSpace; i++) { version[i] = ' '; } sprintf(version+sideSpace, "%s", vertmp); version[width] = '\0'; @@ -795,8 +795,8 @@ void cmCursesMainForm::RemoveEntry(const char* value) // copy from the list box to the cache manager void cmCursesMainForm::FillCacheManagerFromUI() { - int size = this->Entries->size(); - for(int i=0; i < size; i++) + size_t size = this->Entries->size(); + for(size_t i=0; i < size; i++) { cmCacheManager::CacheIterator it = this->CMakeInstance->GetCacheManager()->GetCacheIterator( @@ -866,7 +866,7 @@ void cmCursesMainForm::HandleInput() std::string searchstr = "Search: " + this->SearchString; this->UpdateStatusBar( searchstr.c_str() ); this->PrintKeys(1); - curses_move(y-5,searchstr.size()); + curses_move(y-5,static_cast<unsigned int>(searchstr.size())); //curses_move(1,1); touchwin(stdscr); refresh(); @@ -961,7 +961,7 @@ void cmCursesMainForm::HandleInput() else if ( key == KEY_DOWN || key == ctrl('n') ) { FIELD* cur = current_field(this->Form); - int findex = field_index(cur); + size_t findex = field_index(cur); if ( findex == 3*this->NumberOfVisibleEntries-1 ) { continue; @@ -1108,7 +1108,7 @@ void cmCursesMainForm::HandleInput() { this->OkToGenerate = false; FIELD* cur = current_field(this->Form); - int findex = field_index(cur); + size_t findex = field_index(cur); // make the next or prev. current field after deletion // each entry consists of fields: label, isnew, value @@ -1199,7 +1199,7 @@ void cmCursesMainForm::JumpToCacheEntry(int idx, const char* astr) str = cmSystemTools::LowerCase(astr); } - if ( idx > this->NumberOfVisibleEntries ) + if ( size_t(idx) > this->NumberOfVisibleEntries ) { return; } @@ -1232,7 +1232,7 @@ void cmCursesMainForm::JumpToCacheEntry(int idx, const char* astr) } } } - if ( findex >= 3* this->NumberOfVisibleEntries-1 ) + if ( size_t(findex) >= 3* this->NumberOfVisibleEntries-1 ) { set_current_field(this->Form, this->Fields[2]); } diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index 9751999..4084415 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -147,7 +147,7 @@ protected: // Where is cmake executable std::string WhereCMake; // Number of entries shown (depends on mode -normal or advanced-) - int NumberOfVisibleEntries; + size_t NumberOfVisibleEntries; bool AdvancedMode; // Did the iteration converge (no new entries) ? bool OkToGenerate; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index bd69d6c..4d56257 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1169,7 +1169,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output, if ( tick % tick_line_len == 0 && tick > 0 ) { cmCTestLog(this, HANDLER_OUTPUT, " Size: " - << int((output->size() / 1024.0) + 1) << "K" << std::endl + << int((double(output->size()) / 1024.0) + 1) << "K" << std::endl << " " << std::flush); } } @@ -1181,7 +1181,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output, } } cmCTestLog(this, OUTPUT, " Size of output: " - << int(output->size() / 1024.0) << "K" << std::endl); + << int(double(output->size()) / 1024.0) << "K" << std::endl); cmsysProcess_WaitForExit(cp, 0); diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index dab0c0d..b8a0c95 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -175,6 +175,23 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) { fprintf(fout, "SET(CMAKE_MODULE_PATH %s)\n", def); } + + const char* rulesOverrideBase = "CMAKE_USER_MAKE_RULES_OVERRIDE"; + std::string rulesOverrideLang = + rulesOverrideBase + (lang ? std::string("_") + lang : std::string("")); + if(const char* rulesOverridePath = + this->Makefile->GetDefinition(rulesOverrideLang.c_str())) + { + fprintf(fout, "SET(%s \"%s\")\n", + rulesOverrideLang.c_str(), rulesOverridePath); + } + else if(const char* rulesOverridePath2 = + this->Makefile->GetDefinition(rulesOverrideBase)) + { + fprintf(fout, "SET(%s \"%s\")\n", + rulesOverrideBase, rulesOverridePath2); + } + if(lang) { fprintf(fout, "PROJECT(CMAKE_TRY_COMPILE %s)\n", lang); diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 147f6ac..c198727 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -576,7 +576,7 @@ unsigned int cmELFInternalImpl<Types>::GetDynamicEntryCount() return i; } } - return this->DynamicSectionEntries.size(); + return static_cast<unsigned int>(this->DynamicSectionEntries.size()); } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index b687fe1..4e8e7e6 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -750,8 +750,9 @@ cmGlobalUnixMakefileGenerator3 cmLocalGenerator::FULL, cmLocalGenerator::SHELL); progCmd << " "; - std::vector<int> &progFiles = this->ProgressMap[&t->second].Marks; - for (std::vector<int>::iterator i = progFiles.begin(); + std::vector<unsigned long>& progFiles = + this->ProgressMap[&t->second].Marks; + for (std::vector<unsigned long>::iterator i = progFiles.begin(); i != progFiles.end(); ++i) { progCmd << " " << *i; diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 401888f..f499536 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -177,7 +177,7 @@ protected: TargetProgress(): NumberOfActions(0) {} unsigned long NumberOfActions; std::string VariableFile; - std::vector<int> Marks; + std::vector<unsigned long> Marks; void WriteProgressVariables(unsigned long total, unsigned long& current); }; struct ProgressMapCompare { bool operator()(cmTarget*,cmTarget*) const; }; diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 3bd47a4..19f5c0f 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -739,7 +739,7 @@ bool cmStringCommand alphabet = cmStringCommandDefaultAlphabet; } - double sizeofAlphabet = alphabet.size(); + double sizeofAlphabet = static_cast<double>(alphabet.size()); if ( sizeofAlphabet < 1 ) { this->SetError("sub-command RANDOM invoked with bad alphabet."); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 5f7cfa3..0badbba 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1204,6 +1204,7 @@ bool cmSystemTools::ComputeFileMD5(const char* source, char* md5out) // Should be efficient enough on most system: const int bufferSize = 4096; char buffer[bufferSize]; + unsigned char const* buffer_uc = reinterpret_cast<unsigned char const*>(buffer); // This copy loop is very sensitive on certain platforms with // slightly broken stream libraries (like HPUX). Normally, it is // incorrect to not check the error condition on the fin.read() @@ -1212,10 +1213,9 @@ bool cmSystemTools::ComputeFileMD5(const char* source, char* md5out) while(fin) { fin.read(buffer, bufferSize); - if(fin.gcount()) + if(int gcount = static_cast<int>(fin.gcount())) { - cmsysMD5_Append(md5, reinterpret_cast<unsigned char const*>(buffer), - fin.gcount()); + cmsysMD5_Append(md5, buffer_uc, gcount); } } cmsysMD5_FinalizeHex(md5, md5out); @@ -1989,9 +1989,9 @@ namespace{ # pragma warn -8066 /* unreachable code */ #endif -int copy_data(struct archive *ar, struct archive *aw) +long copy_data(struct archive *ar, struct archive *aw) { - int r; + long r; const void *buff; size_t size; off_t offset; @@ -2136,7 +2136,7 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line, } else if(*outiter == '\n' || *outiter == '\0') { - int length = outiter-out.begin(); + std::vector<char>::size_type length = outiter-out.begin(); if(length > 1 && *(outiter-1) == '\r') { --length; @@ -2159,7 +2159,7 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line, } else if(*erriter == '\n' || *erriter == '\0') { - int length = erriter-err.begin(); + std::vector<char>::size_type length = erriter-err.begin(); if(length > 1 && *(erriter-1) == '\r') { --length; diff --git a/Source/cm_utf8.c b/Source/cm_utf8.c index 3d4ca16..c9bf259 100644 --- a/Source/cm_utf8.c +++ b/Source/cm_utf8.c @@ -50,7 +50,7 @@ const char* cm_utf8_decode_character(const char* first, const char* last, unsigned int* pc) { /* Count leading ones in the first byte. */ - unsigned char c = *first++; + unsigned char c = (unsigned char)*first++; unsigned char const ones = cm_utf8_ones[c]; switch(ones) { @@ -62,10 +62,10 @@ const char* cm_utf8_decode_character(const char* first, const char* last, /* Extract bits from this multi-byte character. */ { unsigned int uc = c & cm_utf8_mask[ones]; - unsigned char left; + int left; for(left = ones-1; left && first != last; --left) { - c = *first++; + c = (unsigned char)*first++; if(cm_utf8_ones[c] != 1) { return 0; diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 6ec7305..dbd6187 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2010) SET(KWSYS_DATE_STAMP_MONTH 07) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 04) +SET(KWSYS_DATE_STAMP_DAY 06) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2c7056d..e00a1cc 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1373,7 +1373,29 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) SET_TESTS_PROPERTIES(CTestTestTimeout PROPERTIES PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*CheckChild *\\.+ *Passed") - + + CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/CTestTestDepends/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake" + @ONLY ESCAPE_QUOTES) + ADD_TEST(CTestTestDepends ${CMAKE_CTEST_COMMAND} + -C "\${CTestTest_CONFIG}" + -S "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake" -V + --output-log "${CMake_BINARY_DIR}/Tests/CTestTestDepends/testOutput.log" + ) + + CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/CTestTestCycle/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake" + @ONLY ESCAPE_QUOTES) + ADD_TEST(CTestTestCycle ${CMAKE_CTEST_COMMAND} + -C "\${CTestTest_CONFIG}" + -S "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake" -V + --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCycle/testOutput.log" + ) + SET_TESTS_PROPERTIES(CTestTestCycle PROPERTIES + PASS_REGULAR_EXPRESSION "a cycle exists in the test dependency graph") + CONFIGURE_FILE( "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake" diff --git a/Tests/CTestTestCycle/CMakeLists.txt b/Tests/CTestTestCycle/CMakeLists.txt new file mode 100644 index 0000000..6ba6b8c --- /dev/null +++ b/Tests/CTestTestCycle/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required (VERSION 2.6) +project(CTestTestCycle) +include(CTest) + +add_executable (simple simple.cxx) +add_test (one simple) +add_test (two simple) +add_test (three simple) + +# Add cyclical test dependency +set_tests_properties(one PROPERTIES DEPENDS "two") +set_tests_properties(two PROPERTIES DEPENDS "three") +set_tests_properties(three PROPERTIES DEPENDS "one") diff --git a/Tests/CTestTestCycle/CTestConfig.cmake b/Tests/CTestTestCycle/CTestConfig.cmake new file mode 100644 index 0000000..43e9986 --- /dev/null +++ b/Tests/CTestTestCycle/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestCycle") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestCycle/simple.cxx b/Tests/CTestTestCycle/simple.cxx new file mode 100644 index 0000000..766b775 --- /dev/null +++ b/Tests/CTestTestCycle/simple.cxx @@ -0,0 +1,5 @@ + +int main() +{ + return 0; +} diff --git a/Tests/CTestTestCycle/test.cmake.in b/Tests/CTestTestCycle/test.cmake.in new file mode 100644 index 0000000..a17adca --- /dev/null +++ b/Tests/CTestTestCycle/test.cmake.in @@ -0,0 +1,22 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.1) + +# Settings: +SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +SET(CTEST_SITE "@SITE@") +SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Cycle") + +SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCycle") +SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCycle") +SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") +SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") +SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") +SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") +SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestDepends/CMakeLists.txt b/Tests/CTestTestDepends/CMakeLists.txt new file mode 100644 index 0000000..26367a6 --- /dev/null +++ b/Tests/CTestTestDepends/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required (VERSION 2.6) +project(CTestTestDepends) +include(CTest) + +add_executable (simple simple.cxx) +add_test (one simple) +add_test (two simple) +add_test (three simple) + +# Add redundant (but not cyclical) dependencies +set_tests_properties(two PROPERTIES DEPENDS "one") +set_tests_properties(three PROPERTIES DEPENDS "one;two") diff --git a/Tests/CTestTestDepends/CTestConfig.cmake b/Tests/CTestTestDepends/CTestConfig.cmake new file mode 100644 index 0000000..e3af7dd --- /dev/null +++ b/Tests/CTestTestDepends/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestDepends") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestDepends/simple.cxx b/Tests/CTestTestDepends/simple.cxx new file mode 100644 index 0000000..766b775 --- /dev/null +++ b/Tests/CTestTestDepends/simple.cxx @@ -0,0 +1,5 @@ + +int main() +{ + return 0; +} diff --git a/Tests/CTestTestDepends/test.cmake.in b/Tests/CTestTestDepends/test.cmake.in new file mode 100644 index 0000000..ed4e182 --- /dev/null +++ b/Tests/CTestTestDepends/test.cmake.in @@ -0,0 +1,22 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.1) + +# Settings: +SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +SET(CTEST_SITE "@SITE@") +SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Depends") + +SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestDepends") +SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestDepends") +SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") +SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") +SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") +SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") +SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index 510851a..0f98e5a 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -731,6 +731,7 @@ FOREACH(var SIZEOF_LONG_LONG SIZEOF___INT64 SIZEOF_SIZE_T + SIZEOF_SSIZE_T SIZEOF_TIME_T ) IF(NOT ${var}_CODE) |