From 5850b8b79a813dbe8ad380c88878260cae3d7cbc Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Tue, 22 Jun 2010 09:17:44 -0600 Subject: Fix performance issue with getting version from zlib.h Some zlib.h files have ZLIB_VERSION "1.2.3.3" with 4 numbers instead of 3. The regex is changed to grab the first 3 numbers. It was slow because if it failed to find that string near the top of the file, where it usually is, it would read the entire file. --- Modules/FindZLIB.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake index b437e6b..7432257 100644 --- a/Modules/FindZLIB.cmake +++ b/Modules/FindZLIB.cmake @@ -38,7 +38,7 @@ MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR) IF (ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") FILE(READ "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H) - STRING(REGEX REPLACE ".*#define ZLIB_VERSION \"([0-9]+)\\.([0-9]+)\\.([0-9]+)\".*" "\\1.\\2.\\3" ZLIB_VERSION_STRING "${ZLIB_H}") + STRING(REGEX REPLACE ".*#define ZLIB_VERSION \"([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\1.\\2.\\3" ZLIB_VERSION_STRING "${ZLIB_H}") ENDIF() # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if -- cgit v0.12 From e6f8a863682eaa8635ed1afe6acdc67591e32746 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Wed, 23 Jun 2010 21:13:07 -0600 Subject: Fix bug 10418 - GetPrerequisites returning "not" as a dependency. ldd can return "not found" and we need to handle it correctly. In that case, we extract only the name of the library instead of trying for its full path. --- Modules/GetPrerequisites.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 24cee55..d450322 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -526,6 +526,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa if("${gp_tool}" STREQUAL "ldd") set(gp_cmd_args "") set(gp_regex "^[\t ]*[^\t ]+ => ([^\t ]+).*${eol_char}$") + set(gp_regex_error "not found${eol_char}$") + set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$") set(gp_regex_cmp_count 1) set(gp_tool_known 1) endif("${gp_tool}" STREQUAL "ldd") @@ -533,6 +535,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa if("${gp_tool}" STREQUAL "otool") set(gp_cmd_args "-L") set(gp_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)\\)${eol_char}$") + set(gp_regex_error "") + set(gp_regex_fallback "") set(gp_regex_cmp_count 3) set(gp_tool_known 1) endif("${gp_tool}" STREQUAL "otool") @@ -540,6 +544,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa if("${gp_tool}" STREQUAL "dumpbin") set(gp_cmd_args "/dependents") set(gp_regex "^ ([^ ].*[Dd][Ll][Ll])${eol_char}$") + set(gp_regex_error "") + set(gp_regex_fallback "") set(gp_regex_cmp_count 1) set(gp_tool_known 1) set(ENV{VS_UNICODE_OUTPUT} "") # Block extra output from inside VS IDE. @@ -629,8 +635,13 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa # foreach(candidate ${candidates}) if("${candidate}" MATCHES "${gp_regex}") + # Extract information from each candidate: - string(REGEX REPLACE "${gp_regex}" "\\1" raw_item "${candidate}") + if(gp_regex_error AND "${candidate}" MATCHES ${gp_regex_error}) + string(REGEX REPLACE "${gp_regex_fallback}" "\\1" raw_item "${candidate}") + else(gp_regex_error AND "${candidate}" MATCHES ${gp_regex_error}) + string(REGEX REPLACE "${gp_regex}" "\\1" raw_item "${candidate}") + endif(gp_regex_error AND "${candidate}" MATCHES ${gp_regex_error}) if(gp_regex_cmp_count GREATER 1) string(REGEX REPLACE "${gp_regex}" "\\2" raw_compat_version "${candidate}") -- cgit v0.12 From 9306f1beee8fdd23c2c8e2ada6917b026c8f57f9 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Thu, 24 Jun 2010 11:14:55 -0600 Subject: Fix regression in 5e6634fd77969433a87c150a2fb3f2079131484f for Windows. --- Modules/GetPrerequisites.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index d450322..f984c58 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -637,11 +637,11 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa if("${candidate}" MATCHES "${gp_regex}") # Extract information from each candidate: - if(gp_regex_error AND "${candidate}" MATCHES ${gp_regex_error}) + if(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}") string(REGEX REPLACE "${gp_regex_fallback}" "\\1" raw_item "${candidate}") - else(gp_regex_error AND "${candidate}" MATCHES ${gp_regex_error}) + else(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}") string(REGEX REPLACE "${gp_regex}" "\\1" raw_item "${candidate}") - endif(gp_regex_error AND "${candidate}" MATCHES ${gp_regex_error}) + endif(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}") if(gp_regex_cmp_count GREATER 1) string(REGEX REPLACE "${gp_regex}" "\\2" raw_compat_version "${candidate}") -- cgit v0.12 From 2aa515db9eabcfbcbf77403b838939eebbbea4d7 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Thu, 24 Jun 2010 20:30:50 -0600 Subject: Change Qt4ConfigDependentSettings to use more standard find modules. Let's use more standard find modules for Qt4 dependencies. Move a few from using pkg-config so we can do cross compiling the cmake way. --- Modules/Qt4ConfigDependentSettings.cmake | 106 +++++++------------------------ 1 file changed, 24 insertions(+), 82 deletions(-) diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake index 1d77c7a..51d5fd9 100644 --- a/Modules/Qt4ConfigDependentSettings.cmake +++ b/Modules/Qt4ConfigDependentSettings.cmake @@ -71,11 +71,8 @@ SET (QT_QTOPENGL_LIB_DEPENDENCIES ${OPENGL_glu_LIBRARY} ${OPENGL_gl_LIBRARY}) ## system png IF(QT_QCONFIG MATCHES "system-png") - FIND_LIBRARY(QT_PNG_LIBRARY NAMES png) - MARK_AS_ADVANCED(QT_PNG_LIBRARY) - IF(QT_PNG_LIBRARY) - SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_PNG_LIBRARY}) - ENDIF(QT_PNG_LIBRARY) + find_package(PNG) + SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${PNG_LIBRARY}) ENDIF(QT_QCONFIG MATCHES "system-png") @@ -141,16 +138,6 @@ IF(QT_QCONFIG MATCHES "xfixes") ENDIF(QT_QCONFIG MATCHES "xfixes") -## system-freetype -IF(QT_QCONFIG MATCHES "system-freetype") - FIND_LIBRARY(QT_FREETYPE_LIBRARY NAMES freetype) - MARK_AS_ADVANCED(QT_FREETYPE_LIBRARY) - IF(QT_FREETYPE_LIBRARY) - SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FREETYPE_LIBRARY}) - ENDIF(QT_FREETYPE_LIBRARY) -ENDIF(QT_QCONFIG MATCHES "system-freetype") - - ## fontconfig IF(QT_QCONFIG MATCHES "fontconfig") FIND_LIBRARY(QT_FONTCONFIG_LIBRARY NAMES fontconfig) @@ -161,13 +148,19 @@ IF(QT_QCONFIG MATCHES "fontconfig") ENDIF(QT_QCONFIG MATCHES "fontconfig") +## system-freetype +IF(QT_QCONFIG MATCHES "system-freetype") + find_package(Freetype) + if(FREETYPE_LIBRARIES) + SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${FREETYPE_LIBRARIES}) + endif(FREETYPE_LIBRARIES) +ENDIF(QT_QCONFIG MATCHES "system-freetype") + + ## system-zlib IF(QT_QCONFIG MATCHES "system-zlib") - FIND_LIBRARY(QT_ZLIB_LIBRARY NAMES z) - MARK_AS_ADVANCED(QT_ZLIB_LIBRARY) - IF(QT_ZLIB_LIBRARY) - SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_ZLIB_LIBRARY}) - ENDIF(QT_ZLIB_LIBRARY) + find_package(ZLIB) + SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${ZLIB_LIBRARIES}) ENDIF(QT_QCONFIG MATCHES "system-zlib") @@ -192,29 +185,11 @@ ENDIF(NOT Q_WS_WIN) ## dbus IF(QT_QCONFIG MATCHES "dbus") - # if the dbus library isn't found, we'll assume its not required to build - # shared Qt on Linux doesn't require it - IF(NOT QT_DBUS_LIBRARY) - EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L dbus-1 - OUTPUT_VARIABLE _dbus_query_output - RESULT_VARIABLE _dbus_result - ERROR_VARIABLE _dbus_query_output ) - - IF(_dbus_result MATCHES 0) - STRING(REPLACE "-L" "" _dbus_query_output "${_dbus_query_output}") - SEPARATE_ARGUMENTS(_dbus_query_output) - ELSE(_dbus_result MATCHES 0) - SET(_dbus_query_output) - ENDIF(_dbus_result MATCHES 0) - - FIND_LIBRARY(QT_DBUS_LIBRARY NAMES dbus-1 PATHS ${_dbus_query_output} ) - - IF(QT_DBUS_LIBRARY) - SET(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY}) - ENDIF(QT_DBUS_LIBRARY) - - MARK_AS_ADVANCED(QT_DBUS_LIBRARY) - ENDIF(NOT QT_DBUS_LIBRARY) + FIND_LIBRARY(QT_DBUS_LIBRARY NAMES dbus-1 ) + IF(QT_DBUS_LIBRARY) + SET(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY}) + ENDIF(QT_DBUS_LIBRARY) + MARK_AS_ADVANCED(QT_DBUS_LIBRARY) ENDIF(QT_QCONFIG MATCHES "dbus") @@ -222,29 +197,11 @@ ENDIF(QT_QCONFIG MATCHES "dbus") ## glib IF(QT_QCONFIG MATCHES "glib") - # if the glib libraries aren't found, we'll assume its not required to build - # shared Qt on Linux doesn't require it - # Qt 4.2.0+ uses glib-2.0 - IF(NOT QT_GLIB_LIBRARY OR NOT QT_GTHREAD_LIBRARY) - EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L glib-2.0 gthread-2.0 - OUTPUT_VARIABLE _glib_query_output - RESULT_VARIABLE _glib_result - ERROR_VARIABLE _glib_query_output ) - - IF(_glib_result MATCHES 0) - STRING(REPLACE "-L" "" _glib_query_output "${_glib_query_output}") - SEPARATE_ARGUMENTS(_glib_query_output) - ELSE(_glib_result MATCHES 0) - SET(_glib_query_output) - ENDIF(_glib_result MATCHES 0) - - FIND_LIBRARY(QT_GLIB_LIBRARY NAMES glib-2.0 PATHS ${_glib_query_output} ) - FIND_LIBRARY(QT_GTHREAD_LIBRARY NAMES gthread-2.0 PATHS ${_glib_query_output} ) - - MARK_AS_ADVANCED(QT_GLIB_LIBRARY) - MARK_AS_ADVANCED(QT_GTHREAD_LIBRARY) - ENDIF(NOT QT_GLIB_LIBRARY OR NOT QT_GTHREAD_LIBRARY) + FIND_LIBRARY(QT_GLIB_LIBRARY NAMES glib-2.0 ) + FIND_LIBRARY(QT_GTHREAD_LIBRARY NAMES gthread-2.0 ) + MARK_AS_ADVANCED(QT_GLIB_LIBRARY) + MARK_AS_ADVANCED(QT_GTHREAD_LIBRARY) IF(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY) SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} @@ -254,23 +211,8 @@ IF(QT_QCONFIG MATCHES "glib") # Qt 4.5+ also links to gobject-2.0 IF(QT_VERSION_MINOR GREATER 4) - IF(NOT QT_GOBJECT_LIBRARY) - EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L gobject-2.0 - OUTPUT_VARIABLE _glib_query_output - RESULT_VARIABLE _glib_result - ERROR_VARIABLE _glib_query_output ) - - IF(_glib_result MATCHES 0) - STRING(REPLACE "-L" "" _glib_query_output "${_glib_query_output}") - SEPARATE_ARGUMENTS(_glib_query_output) - ELSE(_glib_result MATCHES 0) - SET(_glib_query_output) - ENDIF(_glib_result MATCHES 0) - - FIND_LIBRARY(QT_GOBJECT_LIBRARY NAMES gobject-2.0 PATHS ${_glib_query_output} ) - - MARK_AS_ADVANCED(QT_GOBJECT_LIBRARY) - ENDIF(NOT QT_GOBJECT_LIBRARY) + FIND_LIBRARY(QT_GOBJECT_LIBRARY NAMES gobject-2.0 PATHS ${_glib_query_output} ) + MARK_AS_ADVANCED(QT_GOBJECT_LIBRARY) IF(QT_GOBJECT_LIBRARY) SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} -- cgit v0.12 From a77aa7065e14c783a237b83b3db2da6613e7c1b5 Mon Sep 17 00:00:00 2001 From: David Cole Date: Sun, 27 Jun 2010 08:29:15 -0400 Subject: CheckSourceTree test: read UpdateCommand from Update.xml. If GIT_EXECUTABLE is not passed in, and is not available from DartConfiguration.tcl or CTestConfiguration.ini, then make one more last ditch attempt to get it from Update.xml, if there is an Update.xml. For dashboards that have successfully done a ctest_update call, there should be an Update.xml in the Testing subdir of the binary tree. Parse that file for the git executable recorded in the element. And make this test pass on those RogueResearch dashboard machines! --- Tests/CMakeTests/CheckSourceTreeTest.cmake.in | 63 ++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in index 9150aef..73f8b01 100644 --- a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in +++ b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in @@ -149,26 +149,77 @@ if(is_git_checkout AND NOT GIT_EXECUTABLE) # from it: # if(ctest_ini_file) - file(STRINGS "${ctest_ini_file}" lines REGEX "^GITCommand: (.*)$") - string(REGEX REPLACE "^GITCommand: (.*)$" "\\1" exe "${lines}") + file(STRINGS "${ctest_ini_file}" line REGEX "^GITCommand: (.*)$") + string(REGEX REPLACE "^GITCommand: (.*)$" "\\1" line "${line}") + if("${line}" MATCHES "^\"") + string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}") + else() + string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}") + endif() + set(exe "${line}") if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND") set(exe "") endif() + if(exe) + message("info: GIT_EXECUTABLE set by 'GITCommand:' from '${ctest_ini_file}'") + endif() if(NOT exe) - file(STRINGS "${ctest_ini_file}" lines REGEX "^UpdateCommand: (.*)$") - string(REGEX REPLACE "^UpdateCommand: (.*)$" "\\1" exe "${lines}") + file(STRINGS "${ctest_ini_file}" line REGEX "^UpdateCommand: (.*)$") + string(REGEX REPLACE "^UpdateCommand: (.*)$" "\\1" line "${line}") + if("${line}" MATCHES "^\"") + string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}") + else() + string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}") + endif() + set(exe "${line}") if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND") set(exe "") endif() + if(exe) + message("info: GIT_EXECUTABLE set by 'UpdateCommand:' from '${ctest_ini_file}'") + endif() + endif() + else() + message("info: no DartConfiguration.tcl or CTestConfiguration.ini file...") + endif() + + # If we have still not grokked the exe, look in the Update.xml file to see + # if we can parse it from there... + # + if(NOT exe) + file(GLOB_RECURSE update_xml_file "${CMake_BINARY_DIR}/Testing/Update.xml") + if(update_xml_file) + file(STRINGS "${update_xml_file}" line + REGEX "^.*(.*)$" LIMIT_COUNT 1) + string(REPLACE ""\;" "\"" line "${line}") + string(REGEX REPLACE "^.*(.*)$" "\\1" line "${line}") + if("${line}" MATCHES "^\"") + string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}") + else() + string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}") + endif() + if(line) + set(exe "${line}") + endif() + if(exe) + message("info: GIT_EXECUTABLE set by '' from '${update_xml_file}'") + endif() + else() + message("info: no Update.xml file...") endif() endif() if(exe) set(GIT_EXECUTABLE "${exe}") - message("info: set GIT_EXECUTABLE to '${GIT_EXECUTABLE}' based on '${ctest_ini_file}'") + message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'") + message("") + + if(NOT EXISTS "${GIT_EXECUTABLE}") + message(FATAL_ERROR "GIT_EXECUTABLE does not exist...") + endif() else() - message(FATAL_ERROR "could not determine GIT_EXECUTABLE based on '${ctest_ini_file}'...") + message(FATAL_ERROR "could not determine GIT_EXECUTABLE...") endif() endif() -- cgit v0.12 From 415900ba77648c2472bb2022c46136830a627562 Mon Sep 17 00:00:00 2001 From: David Cole Date: Sun, 27 Jun 2010 11:22:05 -0400 Subject: Eliminate -Wconversion warnings. Change types of local variables, or casting, or re-arrange expressions to get rid of "conversion may alter value" warnings as seen on recent dashboard submissions from londinium.kitware. --- Source/CPack/cmCPackDebGenerator.cxx | 6 +++--- Source/CPack/cmCPackNSISGenerator.cxx | 2 +- Source/CTest/cmCTestBuildHandler.cxx | 4 ++-- Source/CTest/cmCTestMultiProcessHandler.cxx | 5 +++-- Source/CTest/cmCTestRunTest.cxx | 12 +++++++----- Source/CTest/cmCTestTestHandler.cxx | 8 +++++--- Utilities/cmcompress/cmcompress.c | 2 +- 7 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 9c77cc1..c254dbb 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -135,7 +135,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName, // now add all directories which have to be compressed // collect all top level install dirs for that // e.g. /opt/bin/foo, /usr/bin/bar and /usr/bin/baz would give /usr and /opt - int topLevelLength = strlen(toplevel); + size_t topLevelLength = strlen(toplevel); std::set installDirs; for (std::vector::const_iterator fileIt = files.begin(); fileIt != files.end(); ++ fileIt ) @@ -431,7 +431,7 @@ static int put_arobj(CF *cfp, struct stat *sb) /* If not truncating names and the name is too long or contains * a space, use extended format 1. */ - unsigned int lname = strlen(name); + size_t lname = strlen(name); uid_t uid = sb->st_uid; gid_t gid = sb->st_gid; if (uid > USHRT_MAX) { @@ -441,7 +441,7 @@ static int put_arobj(CF *cfp, struct stat *sb) gid = USHRT_MAX; } if (lname > sizeof(hdr->ar_name) || strchr(name, ' ')) - (void)sprintf(ar_hb, HDR1, AR_EFMT1, lname, + (void)sprintf(ar_hb, HDR1, AR_EFMT1, (int)lname, (long int)sb->st_mtime, uid, gid, sb->st_mode, (long long)sb->st_size + lname, ARFMAG); else { diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index ad77386..8329546 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -758,7 +758,7 @@ CreateComponentDescription(cmCPackComponent *component, } // Create the NSIS code to download this file on-the-fly. - unsigned totalSizeInKbytes = (totalSize + 512) / 1024; + unsigned long totalSizeInKbytes = (totalSize + 512) / 1024; if (totalSizeInKbytes == 0) { totalSizeInKbytes = 1; diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index bc02fbc..3fd19a5 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -959,7 +959,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, this->ProcessBuffer(0, 0, tick, tick_len, ofs, &this->BuildProcessingErrorQueue); cmCTestLog(this->CTest, OUTPUT, " Size of output: " - << int(this->BuildOutputLogSize / 1024.0) << "K" << std::endl); + << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl); // Properly handle output of the build command cmsysProcess_WaitForExit(cp, 0); @@ -1171,7 +1171,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length, if ( tick % tick_line_len == 0 && tick > 0 ) { cmCTestLog(this->CTest, HANDLER_OUTPUT, " Size: " - << int((this->BuildOutputLogSize / 1024.0) + 1) << "K" << std::endl + << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl << " "); } } diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 1eb84e8..4d39367 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -484,8 +484,9 @@ void cmCTestMultiProcessHandler::CreateTestCostList() } else //we ignore their cost { - this->TestCosts[this->Tests.size() - - this->Properties[i->first]->Index].insert(i->first); + size_t index = this->Tests.size() + - static_cast(this->Properties[i->first]->Index); + this->TestCosts[index].insert(i->first); } } } diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 3719d45..ce44097 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -83,7 +83,8 @@ void cmCTestRunTest::CompressOutput() reinterpret_cast( const_cast(this->ProcessOutput.c_str())); //zlib makes the guarantee that this is the maximum output size - int outSize = static_cast(this->ProcessOutput.size() * 1.001 + 13); + int outSize = static_cast( + static_cast(this->ProcessOutput.size()) * 1.001 + 13.0); unsigned char* out = new unsigned char[outSize]; strm.zalloc = Z_NULL; @@ -342,13 +343,14 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) //---------------------------------------------------------------------- void cmCTestRunTest::ComputeWeightedCost() { - int prev = this->TestProperties->PreviousRuns; - float avgcost = this->TestProperties->Cost; + double prev = static_cast(this->TestProperties->PreviousRuns); + double avgcost = static_cast(this->TestProperties->Cost); double current = this->TestResult.ExecutionTime; if(this->TestResult.Status == cmCTestTestHandler::COMPLETED) { - this->TestProperties->Cost = ((prev * avgcost) + current) / (prev + 1); + this->TestProperties->Cost = + static_cast(((prev * avgcost) + current) / (prev + 1.0)); this->TestProperties->PreviousRuns++; } } @@ -569,7 +571,7 @@ double cmCTestRunTest::ResolveTimeout() { stop_time += 24*60*60; } - int stop_timeout = (stop_time - current_time) % (24*60*60); + int stop_timeout = static_cast(stop_time - current_time) % (24*60*60); this->CTest->LastStopTimeout = stop_timeout; if(stop_timeout <= 0 || stop_timeout > this->CTest->LastStopTimeout) diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index d2742ec..a4a4863 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1048,7 +1048,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector &passed, if(randomSchedule) { - p.Cost = rand(); + p.Cost = static_cast(rand()); } if(p.Timeout == 0 && this->CTest->GetGlobalTimeout() != 0) @@ -1309,7 +1309,8 @@ std::string cmCTestTestHandler::EncodeFile(std::string file) cmSystemTools::RemoveFile(tarFile.c_str()); unsigned char *encoded_buffer - = new unsigned char [ static_cast(len * 1.5 + 5) ]; + = new unsigned char [ static_cast( + static_cast(len) * 1.5 + 5.0) ]; unsigned long rlen = cmsysBase64_Encode(file_buffer, len, encoded_buffer, 1); @@ -1881,7 +1882,8 @@ std::string cmCTestTestHandler::GenerateRegressionImages( unsigned char *file_buffer = new unsigned char [ len + 1 ]; ifs.read(reinterpret_cast(file_buffer), len); unsigned char *encoded_buffer - = new unsigned char [ static_cast(len * 1.5 + 5) ]; + = new unsigned char [ static_cast( + static_cast(len) * 1.5 + 5.0) ]; unsigned long rlen = cmsysBase64_Encode(file_buffer, len, encoded_buffer, 1); diff --git a/Utilities/cmcompress/cmcompress.c b/Utilities/cmcompress/cmcompress.c index 59978f6..ea845ed 100644 --- a/Utilities/cmcompress/cmcompress.c +++ b/Utilities/cmcompress/cmcompress.c @@ -454,7 +454,7 @@ int cmcompress_compress(struct cmcompress_stream* cdata, void* buff, size_t n) { goto nomatch; } - disp = cdata->hsize_reg - i; /* secondary hash (after G. Knott) */ + disp = (int)(cdata->hsize_reg - i); /* secondary hash (after G. Knott) */ if ( i == 0 ) { disp = 1; -- cgit v0.12 From eb7e54fe006f5cbf7970c38626fbcd09d5ce8761 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 28 Jun 2010 10:34:04 -0400 Subject: Begin post-2.8.2 development --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 23dd2a5..d77c377 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -340,8 +340,8 @@ ENDMACRO (CMAKE_BUILD_UTILITIES) SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 8) SET(CMake_VERSION_PATCH 2) -SET(CMake_VERSION_TWEAK 0) -#SET(CMake_VERSION_RC 4) +#SET(CMake_VERSION_TWEAK 0) +#SET(CMake_VERSION_RC 1) # Releases define a tweak level. IF(DEFINED CMake_VERSION_TWEAK) -- cgit v0.12 From cea9389cc94e85d5d5fc705719147bc4ec7f92da Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 28 Jun 2010 11:42:34 -0400 Subject: FindMPI: Trust mpicc -showme on BlueGene/L Do not hard-code known BlueGene/L MPI libraries. We do not know their location so the linker cannot find them without the proper -L search path. The MPI compiler tells us about the libraries anyway, and if it does not then the user can fix the problem locally by editing the MPI_EXTRA_LIBRARY cache entry. --- Modules/FindMPI.cmake | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 481b0e9..ca9649a 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -332,12 +332,6 @@ else (MPI_COMPILE_CMDLINE) set(MPI_LINK_FLAGS "" CACHE STRING "MPI linking flags") endif (MPI_INCLUDE_PATH AND MPI_LIBRARY) -# on BlueGene/L the MPI lib is named libmpich.rts.a, there also these additional libs are required -if("${MPI_LIBRARY}" MATCHES "mpich.rts") - set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY} msglayer.rts devices.rts rts.rts devices.rts) - set(MPI_LIBRARY ${MPI_LIBRARY} msglayer.rts devices.rts rts.rts devices.rts) -endif("${MPI_LIBRARY}" MATCHES "mpich.rts") - # Set up extra variables to conform to if (MPI_EXTRA_LIBRARY) set(MPI_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY}) -- cgit v0.12 From 13ca4ef6656c2d06231e1966ff54a3943459e7e2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 28 Jun 2010 15:51:13 -0400 Subject: VS: Always separate preprocessor defs by semicolon (#10902) Separation by ',' only works in VS 2008 and below and does not work in the PlayStation3 VS plugin. Separation by ';' works in VS 10 and all prior versions. --- Source/cmVisualStudioGeneratorOptions.cxx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 051cc1f..972af95 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -183,7 +183,7 @@ cmVisualStudioGeneratorOptions { fout << prefix << "PreprocessorDefinitions=\""; } - const char* comma = ""; + const char* sep = ""; for(std::vector::const_iterator di = this->Defines.begin(); di != this->Defines.end(); ++di) { @@ -208,15 +208,8 @@ cmVisualStudioGeneratorOptions define = cmVisualStudioGeneratorOptionsEscapeForXML(define.c_str()); } // Store the flag in the project file. - fout << comma << define; - if(this->Version == 10) - { - comma = ";"; - } - else - { - comma = ","; - } + fout << sep << define; + sep = ";"; } if(this->Version == 10) { -- cgit v0.12 From 198e00f6e8341da9804f69c0821222f2d999b3ef Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 29 Jun 2010 00:01:03 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 043f0d0..0c016b7 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 06) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 28) +SET(KWSYS_DATE_STAMP_DAY 29) -- cgit v0.12 From d2222d529d957eef48078c617bdef213961276d8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 29 Jun 2010 08:44:33 -0400 Subject: KWSys: Cleanup putenv leak option implementation Define KWSYS_DO_NOT_CLEAN_PUTENV only for the implementation. It does not need to be configured in the interface of "Configure.hxx". --- Source/kwsys/CMakeLists.txt | 15 +++++++++------ Source/kwsys/Configure.hxx.in | 9 --------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index f440ff9..5e725e4 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -141,12 +141,6 @@ IF(COMMAND SET_PROPERTY) "KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>" ) ENDIF(COMMAND SET_PROPERTY) -# add option to disable memory cleanup at exit of putenv memory -IF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV) - SET(KWSYS_DO_NOT_CLEAN_PUTENV 1) -ELSE(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV) - SET(KWSYS_DO_NOT_CLEAN_PUTENV 0) -ENDIF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV) # Select library components. IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) @@ -605,6 +599,15 @@ ELSE(KWSYS_BUILD_SHARED) ENDIF(KWSYS_BUILD_SHARED) #----------------------------------------------------------------------------- +# Configure some implementation details. + +IF(KWSYS_DO_NOT_CLEAN_PUTENV) + # Disable cleanup of putenv memory for issues with GCOV. + SET_SOURCE_FILES_PROPERTIES(SystemTools.cxx PROPERTIES + COMPILE_FLAGS -DKWSYS_DO_NOT_CLEAN_PUTENV=1) +ENDIF(KWSYS_DO_NOT_CLEAN_PUTENV) + +#----------------------------------------------------------------------------- # Choose a directory for the generated headers. IF(NOT KWSYS_HEADER_ROOT) SET(KWSYS_HEADER_ROOT "${PROJECT_BINARY_DIR}") diff --git a/Source/kwsys/Configure.hxx.in b/Source/kwsys/Configure.hxx.in index 9310d94..716b84f 100644 --- a/Source/kwsys/Configure.hxx.in +++ b/Source/kwsys/Configure.hxx.in @@ -15,15 +15,6 @@ /* Include C configuration. */ #include <@KWSYS_NAMESPACE@/Configure.h> -/* Disable cleanup of putenv memory for issues with GCOV */ -#if @KWSYS_DO_NOT_CLEAN_PUTENV@ -#define KWSYS_DO_NOT_CLEAN_PUTENV -#else -#undef KWSYS_DO_NOT_CLEAN_PUTENV -#endif - - - /* Whether ANSI C++ stream headers are to be used. */ #define @KWSYS_NAMESPACE@_IOS_USE_ANSI @KWSYS_IOS_USE_ANSI@ -- cgit v0.12 From 5c16024fbb3388f8345683263c584f5518fdfa55 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 29 Jun 2010 08:45:33 -0400 Subject: KWSys: Pass ptrdiff_t check result to System.c Since commit "Provide unix-sytle command line parsing" (2009-07-13) the reference to KWSYS_C_HAS_PTRDIFF_T in System.c has been meaningless because the macro was never passed to the compiler! --- Source/kwsys/CMakeLists.txt | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 5e725e4..083629a 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -601,6 +601,14 @@ ENDIF(KWSYS_BUILD_SHARED) #----------------------------------------------------------------------------- # Configure some implementation details. +KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_PTRDIFF_T + "Checking whether C compiler has ptrdiff_t in stddef.h" DIRECT) +KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_SSIZE_T + "Checking whether C compiler has ssize_t in unistd.h" DIRECT) +SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c System.c PROPERTIES + COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}" + ) + IF(KWSYS_DO_NOT_CLEAN_PUTENV) # Disable cleanup of putenv memory for issues with GCOV. SET_SOURCE_FILES_PROPERTIES(SystemTools.cxx PROPERTIES @@ -785,15 +793,6 @@ IF(KWSYS_USE_Process) ELSE(NOT UNIX) # Use the UNIX implementation. SET(KWSYS_C_SRCS ${KWSYS_C_SRCS} ProcessUNIX.c) - - # Help ProcessUNIX.c compile properly on all platforms. - KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_PTRDIFF_T - "Checking whether C compiler has ptrdiff_t in stddef.h" DIRECT) - KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_SSIZE_T - "Checking whether C compiler has ssize_t in unistd.h" DIRECT) - SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c PROPERTIES - COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}" - ) ENDIF(NOT UNIX) ENDIF(KWSYS_USE_Process) -- cgit v0.12 From b65cd9b70b52dc36d51165bd00d551ce01b0465b Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 30 Jun 2010 00:01:03 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 0c016b7..b70c005 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 06) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 29) +SET(KWSYS_DATE_STAMP_DAY 30) -- cgit v0.12 From c00e4ac3f0cbda4473d8fe58acd1e35b799d252e Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 30 Jun 2010 11:28:37 -0400 Subject: From 829fa09a262cb79e95975d8942c8e406c008397f Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 30 Jun 2010 11:23:19 -0400 Subject: [PATCH 1/2] KWSys: Use short fallback timeout for Process tests If any of the KWSys Process tests take more than a minute or two then something is wrong. There is no need to wait for a long default timeout. --- Source/kwsys/CMakeLists.txt | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 083629a..bdf6613 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -1097,6 +1097,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) FOREACH(n 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7}) ADD_TEST(kwsys.testProcess-${n} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n}) KWSYS_SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST}) + SET_TESTS_PROPERTIES(kwsys.testProcess-${n} PROPERTIES TIMEOUT 120) ENDFOREACH(n) # Some Apple compilers produce bad optimizations in this source. -- 1.7.0 --- Source/kwsys/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 083629a..bdf6613 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -1097,6 +1097,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) FOREACH(n 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7}) ADD_TEST(kwsys.testProcess-${n} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n}) KWSYS_SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST}) + SET_TESTS_PROPERTIES(kwsys.testProcess-${n} PROPERTIES TIMEOUT 120) ENDFOREACH(n) # Some Apple compilers produce bad optimizations in this source. -- cgit v0.12 From 26ea271b0f560e40cc9d0f1cdc55c73d1863172c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 30 Jun 2010 11:28:56 -0400 Subject: From 83cf3fa2fe65b99758899463ca25941eb3fb3989 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 30 Jun 2010 11:25:42 -0400 Subject: [PATCH 2/2] KWSys: Optionally suppress consistent test failures Add option KWSYS_TEST_BOGUS_FAILURES that can be set by a containing project or in the CMake cache to list tests known to fail consistently on a buggy system. --- Source/kwsys/CMakeLists.txt | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index bdf6613..bcc7a96 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -1125,5 +1125,11 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES MEASUREMENT "Some Key=Some Value") MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}") ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) + + # Suppress known consistent failures on buggy systems. + IF(KWSYS_TEST_BOGUS_FAILURES) + SET_TESTS_PROPERTIES(${KWSYS_TEST_BOGUS_FAILURES} PROPERTIES WILL_FAIL ON) + ENDIF() + ENDIF(BUILD_TESTING) ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) -- 1.7.0 --- Source/kwsys/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index bdf6613..bcc7a96 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -1125,5 +1125,11 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES MEASUREMENT "Some Key=Some Value") MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}") ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) + + # Suppress known consistent failures on buggy systems. + IF(KWSYS_TEST_BOGUS_FAILURES) + SET_TESTS_PROPERTIES(${KWSYS_TEST_BOGUS_FAILURES} PROPERTIES WILL_FAIL ON) + ENDIF() + ENDIF(BUILD_TESTING) ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) -- cgit v0.12 From b84220b28716ef7bf3395edf4386a1a038ec9495 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 30 Jun 2010 11:28:37 -0400 Subject: KWSys: Use short fallback timeout for Process tests If any of the KWSys Process tests take more than a minute or two then something is wrong. There is no need to wait for a long default timeout. --- Source/kwsys/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 083629a..bdf6613 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -1097,6 +1097,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) FOREACH(n 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7}) ADD_TEST(kwsys.testProcess-${n} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n}) KWSYS_SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST}) + SET_TESTS_PROPERTIES(kwsys.testProcess-${n} PROPERTIES TIMEOUT 120) ENDFOREACH(n) # Some Apple compilers produce bad optimizations in this source. -- cgit v0.12 From 3b26fa13c42e8cf26b5b7dda57e4a3aac5f1cb11 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 30 Jun 2010 11:28:56 -0400 Subject: KWSys: Optionally suppress consistent test failures Add option KWSYS_TEST_BOGUS_FAILURES that can be set by a containing project or in the CMake cache to list tests known to fail consistently on a buggy system. --- Source/kwsys/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index bdf6613..bcc7a96 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -1125,5 +1125,11 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES MEASUREMENT "Some Key=Some Value") MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}") ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) + + # Suppress known consistent failures on buggy systems. + IF(KWSYS_TEST_BOGUS_FAILURES) + SET_TESTS_PROPERTIES(${KWSYS_TEST_BOGUS_FAILURES} PROPERTIES WILL_FAIL ON) + ENDIF() + ENDIF(BUILD_TESTING) ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) -- cgit v0.12 From 6ebb4843a6414acc6118e916b973f591fe481c8b Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 1 Jul 2010 00:01:03 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index b70c005..b1fe226 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -15,7 +15,7 @@ SET(KWSYS_DATE_STAMP_YEAR 2010) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 06) +SET(KWSYS_DATE_STAMP_MONTH 07) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 30) +SET(KWSYS_DATE_STAMP_DAY 01) -- cgit v0.12 From 9f3524f4696f394e04077aed93b482ed72cda4ca Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 2 Jul 2010 00:01:06 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index b1fe226..52a4b4a 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 01) +SET(KWSYS_DATE_STAMP_DAY 02) -- cgit v0.12 From c3389d4ce2a8d3ee0ec1d4824a64347ded5832a0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 2 Jul 2010 13:57:19 -0400 Subject: KWSys: Avoid Clang optimizer bug in testProcess-[45] Clang's optimizer, as of clang version 2.8 (trunk 107463), produces the undefined instruction 'ud2' for the code "*(int*)0=0" on OS X x86_64. It causes our crash tests to fail because the child process exits with an invalid instruction instead of a segmentation fault. Work around the bug by using "*(int*)1=0" in this case. --- Source/kwsys/testProcess.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/kwsys/testProcess.c b/Source/kwsys/testProcess.c index 0060c4d..6044917 100644 --- a/Source/kwsys/testProcess.c +++ b/Source/kwsys/testProcess.c @@ -94,7 +94,12 @@ int test4(int argc, const char* argv[]) fprintf(stderr, "Output before crash on stderr from crash test.\n"); fflush(stdout); fflush(stderr); +#if defined(__APPLE__) && defined(__x86_64__) && defined(__OPTIMIZE__) \ + && defined(__clang__) + *(int*)1 = 0; /* Clang's optimizer produces bad code for 0-ptr. */ +#else *(int*)0 = 0; +#endif fprintf(stdout, "Output after crash on stdout from crash test.\n"); fprintf(stderr, "Output after crash on stderr from crash test.\n"); return 0; -- cgit v0.12 From 4b661784b46f6017b12d0c2eb65bdbe649a0507a Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 3 Jul 2010 00:01:24 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 52a4b4a..633d639 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 02) +SET(KWSYS_DATE_STAMP_DAY 03) -- cgit v0.12 From efee95cd710808ca7ac261359b9b8e6dacb09211 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 4 Jul 2010 00:01:06 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 633d639..6ec7305 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 03) +SET(KWSYS_DATE_STAMP_DAY 04) -- cgit v0.12 From dbe7525c6e623c3be1dad7dae5948e71b5ac2b6b Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Thu, 20 May 2010 15:09:46 +0200 Subject: clean up some stuff in CPack RPM script -remove trailing whitespace -fix description of CPACK_RPM_PACKAGE_SUMMARY -fix description of CPACK_RPM_PACKAGE_VENDOR -fix description of CPACK_RPM_PACKAGE_PROVIDES -do not put changelog of that file to generated RPM but read it from CPACK_RPM_CHANGELOG_FILE -add CPACK_RPM_PACKAGE_URL -add CPACK_RPM_PACKAGE_OBSOLETES -add CPACK_RPM_PACKAGE_SUGGESTS -add a loop so adding more user supplied header fields is easy Signed-off-by: Eric NOULARD --- Modules/CPackRPM.cmake | 183 +++++++++++++++++++++++++------------------------ 1 file changed, 95 insertions(+), 88 deletions(-) diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 3bf8e0e..4a14109 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -4,14 +4,14 @@ # used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration # # However CPackRPM has specific features which are controlled by -# the specifics CPACK_RPM_XXX variables. You'll find a detailed usage on -# the wiki: +# the specifics CPACK_RPM_XXX variables. You'll find a detailed usage on +# the wiki: # http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29 # However as a handy reminder here comes the list of specific variables: # -# CPACK_RPM_PACKAGE_SUMMARY +# CPACK_RPM_PACKAGE_SUMMARY # Mandatory : YES -# Default : CPACK_PACKAGE_DESCRIPTION +# Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY # The RPM package summary # CPACK_RPM_PACKAGE_NAME # Mandatory : YES @@ -24,14 +24,14 @@ # CPACK_RPM_PACKAGE_ARCHITECTURE # Mandatory : NO # Default : - -# The RPM package architecture. This may be set to "noarch" if you +# The RPM package architecture. This may be set to "noarch" if you # know you are building a noarch package. # CPACK_RPM_PACKAGE_RELEASE # Mandatory : YES # Default : 1 -# The RPM package release. This is the numbering of the RPM package -# itself, i.e. the version of the packaging and not the version of the -# content (see CPACK_RPM_PACKAGE_VERSION). One may change the default +# The RPM package release. This is the numbering of the RPM package +# itself, i.e. the version of the packaging and not the version of the +# content (see CPACK_RPM_PACKAGE_VERSION). One may change the default # value if the previous packaging was buggy and/or you want to put here # a fancy Linux distro specific numbering. # CPACK_RPM_PACKAGE_LICENSE @@ -42,10 +42,14 @@ # Mandatory : YES # Default : "unknown" # The RPM package group. -# CPACK_RPM_PACKAGE_VENDOR +# CPACK_RPM_PACKAGE_VENDOR # Mandatory : YES # Default : CPACK_PACKAGE_VENDOR if set or "unknown" -# The RPM package group. +# The RPM package vendor. +# CPACK_RPM_PACKAGE_URL +# Mandatory : NO +# Default : - +# The projects URL. # CPACK_RPM_PACKAGE_DESCRIPTION # Mandatory : YES # Default : CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package description available" @@ -61,18 +65,27 @@ # Mandatory : NO # Default : - # May be used to set RPM dependencies (requires). -# Note that you must enclose the complete requires string between quotes, +# Note that you must enclose the complete requires string between quotes, # for example: # set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8") -# CPACK_RPM_PACKAGES_PROVIDES +# CPACK_RPM_PACKAGE_SUGGESTS +# Mandatory : NO +# Default : - +# May be used to set weak RPM dependencies (suggests). +# Note that you must enclose the complete requires string between quotes. +# CPACK_RPM_PACKAGE_PROVIDES # Mandatory : NO # Default : - # May be used to set RPM dependencies (provides). +# CPACK_RPM_PACKAGE_OBSOLETES +# Mandatory : NO +# Default : - +# May be used to set RPM packages that are obsoleted by this one. # CPACK_RPM_SPEC_INSTALL_POST # Mandatory : NO # Default : - -# May be used to set an RPM post-install command inside the spec file. -# For example setting it to "/bin/true" may be used to prevent +# May be used to set an RPM post-install command inside the spec file. +# For example setting it to "/bin/true" may be used to prevent # rpmbuild to strip binaries. # CPACK_RPM_SPEC_MORE_DEFINE # Mandatory : NO @@ -81,19 +94,19 @@ # CPACK_RPM_PACKAGE_DEBUG # Mandatory : NO # Default : - -# May be set when invoking cpack in order to trace debug informations -# during CPack RPM run. For example you may launch CPack like this +# May be set when invoking cpack in order to trace debug informations +# during CPack RPM run. For example you may launch CPack like this # cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM # CPACK_RPM_USER_BINARY_SPECFILE # Mandatory : NO -# Default : - +# Default : - # May be set by the user in order to specify a USER binary spec file # to be used by CPackRPM instead of generating the file. # The specified file will be processed by CONFIGURE_FILE( @ONLY). # CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE # Mandatory : NO # Default : - -# If set CPack will generate a template for USER specified binary +# If set CPack will generate a template for USER specified binary # spec file and stop with an error. For example launch CPack like this # cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM # The user may then use this file in order to hand-craft is own @@ -116,6 +129,12 @@ # put after the %post or %postun section # One may verify which scriptlet has been included with # rpm -qp --scripts package.rpm +# CPACK_RPM_CHANGELOG_FILE +# Mandatory : NO +# Default : - +# May be used to embbed a changelog in the spec file. +# The refered file will be read and directly put after the %changelog +# section. #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -141,23 +160,23 @@ IF(NOT UNIX) ENDIF(NOT UNIX) # rpmbuild is the basic command for building RPM package -# it may be a simple (symbolic) link to rpmb command. +# it may be a simple (symbolic) link to rpm command. FIND_PROGRAM(RPMBUILD_EXECUTABLE rpmbuild) -# Check version of the rpmbuild tool this would be easier to +# Check version of the rpmbuild tool this would be easier to # track bugs with users and CPackRPM debug mode. -# We may use RPM version in order to check for available version dependent features +# We may use RPM version in order to check for available version dependent features IF(RPMBUILD_EXECUTABLE) execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --version OUTPUT_VARIABLE _TMP_VERSION ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - string(REGEX REPLACE "^.*\ " "" + string(REGEX REPLACE "^.*\ " "" RPMBUILD_EXECUTABLE_VERSION - ${_TMP_VERSION}) + ${_TMP_VERSION}) IF(CPACK_RPM_PACKAGE_DEBUG) MESSAGE("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>") - ENDIF(CPACK_RPM_PACKAGE_DEBUG) + ENDIF(CPACK_RPM_PACKAGE_DEBUG) ENDIF(RPMBUILD_EXECUTABLE) IF(NOT RPMBUILD_EXECUTABLE) @@ -165,14 +184,14 @@ IF(NOT RPMBUILD_EXECUTABLE) ENDIF(NOT RPMBUILD_EXECUTABLE) # We may use RPM version in the future in order -# to shut down warning about space in buildtree +# to shut down warning about space in buildtree # some recent RPM version should support space in different places. # not checked [yet]. IF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*") MESSAGE(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.") ENDIF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*") -# If rpmbuild is found +# If rpmbuild is found # we try to discover alien since we may be on non RPM distro like Debian. # In this case we may try to to use more advanced features # like generating RPM directly from DEB using alien. @@ -182,7 +201,7 @@ IF(ALIEN_EXECUTABLE) MESSAGE(STATUS "alien found, we may be on a Debian based distro.") ENDIF(ALIEN_EXECUTABLE) -# +# # Use user-defined RPM specific variables value # or generate reasonable default value from # CPACK_xxx generic values. @@ -197,10 +216,10 @@ IF(NOT CPACK_RPM_PACKAGE_SUMMARY) IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY) ELSE(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) - SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}) + SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}) ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) ENDIF(NOT CPACK_RPM_PACKAGE_SUMMARY) - + # CPACK_RPM_PACKAGE_NAME (mandatory) IF(NOT CPACK_RPM_PACKAGE_NAME) STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME) @@ -294,25 +313,22 @@ IF (CPACK_RPM_COMPRESSION_TYPE) ELSE(CPACK_RPM_COMPRESSION_TYPE) SET(CPACK_RPM_COMPRESSION_TYPE_TMP "") ENDIF(CPACK_RPM_COMPRESSION_TYPE) -# CPACK_RPM_PACKAGE_REQUIRES -# Placeholder used to specify binary RPM dependencies (if any) -# see http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html -IF(CPACK_RPM_PACKAGE_REQUIRES) - IF(CPACK_RPM_PACKAGE_DEBUG) - MESSAGE("CPackRPM:Debug: User defined Requires:\n ${CPACK_RPM_PACKAGE_REQUIRES}") - ENDIF(CPACK_RPM_PACKAGE_DEBUG) - SET(TMP_RPM_REQUIRES "Requires: ${CPACK_RPM_PACKAGE_REQUIRES}") -ENDIF(CPACK_RPM_PACKAGE_REQUIRES) -# CPACK_RPM_PACKAGE_PROVIDES -# Placeholder used to specify binary RPM dependencies (if any) -# see http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html -IF(CPACK_RPM_PACKAGE_PROVIDES) - IF(CPACK_RPM_PACKAGE_DEBUG) - MESSAGE("CPackRPM:Debug: User defined Provides:\n ${CPACK_RPM_PACKAGE_PROVIDES}") - ENDIF(CPACK_RPM_PACKAGE_DEBUG) - SET(TMP_RPM_PROVIDES "Provides: ${CPACK_RPM_PACKAGE_PROVIDES}") -ENDIF(CPACK_RPM_PACKAGE_PROVIDES) +# check if additional fields for RPM spec header are given +FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES) + IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}) + STRING(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH) + MATH(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1") + STRING(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL) + STRING(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL) + STRING(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME) + SET(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}") + IF(CPACK_RPM_PACKAGE_DEBUG) + MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}") + ENDIF(CPACK_RPM_PACKAGE_DEBUG) + SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}") + ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}) +ENDFOREACH(_RPM_SPEC_HEADER) # CPACK_RPM_SPEC_INSTALL_POST # May be used to define a RPM post intallation script @@ -348,7 +364,7 @@ endif(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE) # CPACK_RPM_PRE_INSTALL_SCRIPT_FILE # CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE -# May be used to embbed a pre (un)installation script in the spec file. +# May be used to embed a pre (un)installation script in the spec file. # The refered script file(s) will be read and directly # put after the %pre or %preun section if(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE) @@ -367,6 +383,17 @@ if(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE) endif(EXISTS ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE}) endif(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE) +# CPACK_RPM_CHANGELOG_FILE +# May be used to embed a changelog in the spec file. +# The refered file will be read and directly put after the %changelog section +if(CPACK_RPM_CHANGELOG_FILE) + if(EXISTS ${CPACK_RPM_CHANGELOG_FILE}) + file(READ ${CPACK_RPM_CHANGELOG_FILE} CPACK_RPM_SPEC_CHANGELOG) + else(EXISTS ${CPACK_RPM_CHANGELOG_FILE}) + message(SEND_ERROR "CPackRPM:Warning: CPACK_RPM_CHANGELOG_FILE <${CPACK_RPM_CHANGELOG_FILE}> does not exists - ignoring") + endif(EXISTS ${CPACK_RPM_CHANGELOG_FILE}) +endif(CPACK_RPM_CHANGELOG_FILE) + # CPACK_RPM_SPEC_MORE_DEFINE # This is a generated spec rpm file spaceholder IF(CPACK_RPM_SPEC_MORE_DEFINE) @@ -407,7 +434,7 @@ EXECUTE_PROCESS(COMMAND find -type f -o -type l # The name of the final spec file to be used by rpmbuild SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}.spec") - + # Print out some debug information if we were asked for that IF(CPACK_RPM_PACKAGE_DEBUG) MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}") @@ -420,7 +447,7 @@ IF(CPACK_RPM_PACKAGE_DEBUG) MESSAGE("CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}") MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}") ENDIF(CPACK_RPM_PACKAGE_DEBUG) - + # USER generated spec file handling. # We should generate a spec file template: # - either because the user asked for it : CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE @@ -429,7 +456,7 @@ ENDIF(CPACK_RPM_PACKAGE_DEBUG) IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE) FILE(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in "# -*- rpm-spec -*- -Buildroot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@ +BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@ Summary: \@CPACK_RPM_PACKAGE_SUMMARY\@ Name: \@CPACK_RPM_PACKAGE_NAME\@ Version: \@CPACK_RPM_PACKAGE_VERSION\@ @@ -437,10 +464,12 @@ Release: \@CPACK_RPM_PACKAGE_RELEASE\@ License: \@CPACK_RPM_PACKAGE_LICENSE\@ Group: \@CPACK_RPM_PACKAGE_GROUP\@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ +\@TMP_RPM_URL\@ \@TMP_RPM_REQUIRES\@ \@TMP_RPM_PROVIDES\@ +\@TMP_RPM_OBSOLETES\@ \@TMP_RPM_BUILDARCH\@ - + #p define prefix \@CMAKE_INSTALL_PREFIX\@ %define _rpmdir \@CPACK_RPM_DIRECTORY\@ %define _rpmfilename \@CPACK_RPM_FILE_NAME\@ @@ -449,7 +478,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@TMP_RPM_SPEC_INSTALL_POST\@ \@CPACK_RPM_SPEC_MORE_DEFINE\@ \@CPACK_RPM_COMPRESSION_TYPE_TMP\@ - + %description \@CPACK_RPM_PACKAGE_DESCRIPTION\@ @@ -461,14 +490,14 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ mv $RPM_BUILD_ROOT \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot #p build - + %install if [ -e $RPM_BUILD_ROOT ]; then - mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot/* $RPM_BUILD_ROOT + mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot/* $RPM_BUILD_ROOT else - mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot $RPM_BUILD_ROOT -fi + mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot $RPM_BUILD_ROOT +fi %clean @@ -489,61 +518,39 @@ fi ${CPACK_RPM_INSTALL_FILES} %changelog -* Sun Apr 4 2010 Erk - Add support for specifying RPM compression type -* Sat Nov 28 2009 Erk - Refix backup/restore install tree for OpenSuSE 11.2 -* Sun Nov 22 2009 Erk - Include symlinks in the file list. -* Sat Nov 14 2009 Erk - Replace prep and build step with backup and restore - of the previously CPack installed tree. This should - mimic what is expected in rpmbuild usual steps -* Wed Nov 11 2009 Erk - Add support for USER defined pre/post[un]install scripts -* Wed Oct 07 2009 Erk - Add user custom spec file support -* Sat Oct 03 2009 Kami - Update to handle more precisely the files section -* Mon Oct 03 2008 Erk - Update generator to handle optional dependencies using Requires - Update DEBUG output typos. -* Mon Aug 25 2008 Erk - Update generator to handle optional post-install -* Tue Aug 16 2007 Erk - Generated by CPack RPM Generator and associated macros +\@CPACK_RPM_SPEC_CHANGELOG\@ ") # Stop here if we were asked to only generate a template USER spec file # The generated file may then be used as a template by user who wants - # to customize their own spec file. + # to customize their own spec file. IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE) MESSAGE(FATAL_ERROR "CPackRPM: STOP here Generated USER binary spec file templare is: ${CPACK_RPM_BINARY_SPECFILE}.in") ENDIF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE) ENDIF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE) # After that we may either use a user provided spec file -# or generate one using appropriate variables value. +# or generate one using appropriate variables value. IF(CPACK_RPM_USER_BINARY_SPECFILE) # User may have specified SPECFILE just use it MESSAGE("CPackRPM: Will use USER specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}") # The user provided file is processed for @var replacement CONFIGURE_FILE(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY) ELSE(CPACK_RPM_USER_BINARY_SPECFILE) - # No User specified spec file, will use the generated spec file - MESSAGE("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}") - # Note the just created file is processed for @var replacement + # No User specified spec file, will use the generated spec file + MESSAGE("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}") + # Note the just created file is processed for @var replacement CONFIGURE_FILE(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY) ENDIF(CPACK_RPM_USER_BINARY_SPECFILE) IF(RPMBUILD_EXECUTABLE) # Now call rpmbuild using the SPECFILE EXECUTE_PROCESS( - COMMAND "${RPMBUILD_EXECUTABLE}" -bb - --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}" + COMMAND "${RPMBUILD_EXECUTABLE}" -bb + --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}" "${CPACK_RPM_BINARY_SPECFILE}" WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}" ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err" - OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out") + OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out") IF(CPACK_RPM_PACKAGE_DEBUG) MESSAGE("CPackRPM:Debug: You may consult rpmbuild logs in: ") MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err") -- cgit v0.12