summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXKeyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXKeyboard.c')
0 files changed, 0 insertions, 0 deletions
ing-TIMESTAMP-UnknownSpecifier.cmake new file mode 100644 index 0000000..0e145e5 --- /dev/null +++ b/Tests/CMakeTests/String-TIMESTAMP-UnknownSpecifier.cmake @@ -0,0 +1,2 @@ +string(TIMESTAMP output "%g") +message("~${output}~") diff --git a/Tests/CMakeTests/StringTest.cmake.in b/Tests/CMakeTests/StringTest.cmake.in index 49e7dc9..a9fe428 100644 --- a/Tests/CMakeTests/StringTest.cmake.in +++ b/Tests/CMakeTests/StringTest.cmake.in @@ -16,6 +16,26 @@ set(SHA384-Works-RESULT 0) set(SHA384-Works-STDERR "1de9560b4e030e02051ea408200ffc55d70c97ac64ebf822461a5c786f495c36df43259b14483bc8d364f0106f4971ee") set(SHA512-Works-RESULT 0) set(SHA512-Works-STDERR "3982a1b4e651768bec70ab1fb97045cb7a659f4ba7203d501c52ab2e803071f9d5fd272022df15f27727fc67f8cd022e710e29010b2a9c0b467c111e2f6abf51") +set(TIMESTAMP-BadArg1-RESULT 1) +set(TIMESTAMP-BadArg1-STDERR "string sub-command TIMESTAMP requires at least one argument") +set(TIMESTAMP-BadArg2-RESULT 1) +set(TIMESTAMP-BadArg2-STDERR "string TIMESTAMP sub-command does not recognize option UTF") +set(TIMESTAMP-BadArg3-RESULT 1) +set(TIMESTAMP-BadArg3-STDERR "string sub-command TIMESTAMP takes at most three arguments") +set(TIMESTAMP-DefaultFormatLocal-RESULT 0) +set(TIMESTAMP-DefaultFormatLocal-STDERR "~[0-9]*-[01][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-6][0-9]~") +set(TIMESTAMP-DefaultFormatUTC-RESULT 0) +set(TIMESTAMP-DefaultFormatUTC-STDERR "~[0-9]*-[01][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-6][0-9]Z~") +set(TIMESTAMP-CustomFormatLocal-RESULT 0) +set(TIMESTAMP-CustomFormatLocal-STDERR "~([0-5][0-9])|60~") +set(TIMESTAMP-CustomFormatUTC-RESULT 0) +set(TIMESTAMP-CustomFormatUTC-STDERR "~([0-5][0-9])|60~") +set(TIMESTAMP-UnknownSpecifier-RESULT 0) +set(TIMESTAMP-UnknownSpecifier-STDERR "~%g~") +set(TIMESTAMP-IncompleteSpecifier-RESULT 0) +set(TIMESTAMP-IncompleteSpecifier-STDERR "~foobar%~") +set(TIMESTAMP-AllSpecifiers-RESULT 0) +set(TIMESTAMP-AllSpecifiers-STDERR "~[0-9]+(;[0-9]+)*~") include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") check_cmake_test(String @@ -28,6 +48,16 @@ check_cmake_test(String SHA256-Works SHA384-Works SHA512-Works + TIMESTAMP-BadArg1 + TIMESTAMP-BadArg2 + TIMESTAMP-BadArg3 + TIMESTAMP-DefaultFormatLocal + TIMESTAMP-DefaultFormatUTC + TIMESTAMP-CustomFormatLocal + TIMESTAMP-CustomFormatUTC + TIMESTAMP-UnknownSpecifier + TIMESTAMP-IncompleteSpecifier + TIMESTAMP-AllSpecifiers ) # Execute each test listed in StringTestScript.cmake: -- cgit v0.12 From d842d9062297435747117bd74b6e184cedd345cc Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 5 Dec 2012 09:55:27 -0500 Subject: CMake: Stylistic changes and documentation tweaks ...for the contributed file and string TIMESTAMP sub-commands. --- Source/cmFileCommand.h | 7 ++- Source/cmStringCommand.h | 4 +- Source/cmTimestamp.cxx | 50 ++++++++++++---------- .../String-TIMESTAMP-DefaulFormatUTC.cmake | 2 - 4 files changed, 33 insertions(+), 30 deletions(-) delete mode 100644 Tests/CMakeTests/String-TIMESTAMP-DefaulFormatUTC.cmake diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index 5550dbe..5973fa7 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -87,8 +87,7 @@ public: " [TLS_VERIFY on|off] [TLS_CAINFO file])\n" " file(UPLOAD filename url [INACTIVITY_TIMEOUT timeout]\n" " [TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS])\n" - " file(TIMESTAMP " - " [] [UTC])\n" + " file(TIMESTAMP filename variable [] [UTC])\n" "WRITE will write a message into a file called 'filename'. It " "overwrites the file if it already exists, and creates the file " "if it does not exist. (If the file is a build input, use " @@ -203,9 +202,9 @@ public: "as status messages until the operation is complete." "\n" "TIMESTAMP will write a string representation of " - "the modification time of to .\n" + "the modification time of filename to variable.\n" "Should the command be unable to obtain a timestamp " - " will be set to the empty string \"\".\n" + "variable will be set to the empty string \"\".\n" "See documentation of the string TIMESTAMP sub-command for more details." "\n" "The file() command also provides COPY and INSTALL signatures:\n" diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index 7e0694e..4423a90 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -145,9 +145,9 @@ public: " by all regular expression-related commands, including \n" " e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9).\n" "TIMESTAMP will write a string representation of " - "the current date and/or time to .\n" + "the current date and/or time to the output variable.\n" "Should the command be unable to obtain a timestamp " - " will be set to the empty string \"\".\n" + "the output variable will be set to the empty string \"\".\n" "The optional UTC flag requests the current date/time " "representation to be in Coordinated Universal Time (UTC) " "rather than local time.\n" diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index f1115e6..c3df495 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -21,62 +21,68 @@ std::string cmTimestamp::CurrentTime( const std::string& formatString, bool utcFlag) { time_t currentTimeT = time(0); - if(currentTimeT == time_t(-1)) return std::string(); + if(currentTimeT == time_t(-1)) + { + return std::string(); + } return CreateTimestampFromTimeT(currentTimeT, formatString, utcFlag); } +//---------------------------------------------------------------------------- std::string cmTimestamp::FileModificationTime(const char* path, const std::string& formatString, bool utcFlag) { #ifdef _WIN32 - struct _stat info; - std::memset(&info, 0, sizeof(info)); - - if(_stat(path, &info) != 0) - return std::string(); - - time_t currentTimeT = info.st_mtime; + #define STAT _stat #else - struct stat info; + #define STAT stat +#endif + + struct STAT info; std::memset(&info, 0, sizeof(info)); - if(stat(path, &info) != 0) + if(STAT(path, &info) != 0) + { return std::string(); + } - time_t currentTimeT = info.st_mtime; -#endif - - return CreateTimestampFromTimeT(currentTimeT, formatString, utcFlag); + return CreateTimestampFromTimeT(info.st_mtime, formatString, utcFlag); } +//---------------------------------------------------------------------------- std::string cmTimestamp::CreateTimestampFromTimeT(time_t timeT, std::string formatString, bool utcFlag) { if(formatString.empty()) { formatString = "%Y-%m-%dT%H:%M:%S"; - if(utcFlag) formatString += "Z"; + if(utcFlag) + { + formatString += "Z"; + } } struct tm timeStruct; std::memset(&timeStruct, 0, sizeof(timeStruct)); + struct tm* ptr = (struct tm*) 0; if(utcFlag) { - tm* ptr = gmtime(&timeT); - if(ptr == 0) return std::string(); - - timeStruct = *ptr; + ptr = gmtime(&timeT); } else { - struct tm* ptr = localtime(&timeT); - if(ptr == 0) return std::string(); + ptr = localtime(&timeT); + } - timeStruct = *ptr; + if(ptr == 0) + { + return std::string(); } + timeStruct = *ptr; + std::string result; for(std::string::size_type i = 0; i < formatString.size(); ++i) { diff --git a/Tests/CMakeTests/String-TIMESTAMP-DefaulFormatUTC.cmake b/Tests/CMakeTests/String-TIMESTAMP-DefaulFormatUTC.cmake deleted file mode 100644 index dad6a8d..0000000 --- a/Tests/CMakeTests/String-TIMESTAMP-DefaulFormatUTC.cmake +++ /dev/null @@ -1,2 +0,0 @@ -string(TIMESTAMP output UTC) -message("~${output}~") -- cgit v0.12 From f80ccac158c11b21319e6f4a82137bcc88f0dfaf Mon Sep 17 00:00:00 2001 From: Amit Kulkarni Date: Wed, 5 Dec 2012 11:36:14 -0600 Subject: OpenBSD: Add paths for Qt3/Qt4 Handle OpenBSD specific paths in Qt3/Qt4, allowing concurrent building and installation. Some common programs are renamed with suffixes of either 3 or 4. Also, allow qt3/qt4 installed under /usr/local to be searched and recognized appropriately. --- Modules/FindQt.cmake | 14 ++++++++++++++ Modules/FindQt3.cmake | 6 ++++-- Modules/FindQt4.cmake | 12 ++++++------ 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index 541cc05..54b7c6f 100644 --- a/Modules/FindQt.cmake +++ b/Modules/FindQt.cmake @@ -43,6 +43,12 @@ if(GLOB_TEMP_VAR) endif() set(GLOB_TEMP_VAR) +file(GLOB GLOB_TEMP_VAR /usr/local/lib/qt3/bin/qmake) +if(GLOB_TEMP_VAR) + set(QT3_INSTALLED TRUE) +endif() +set(GLOB_TEMP_VAR) + # look for qt4 installations file(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-4*/bin/qmake) if(GLOB_TEMP_VAR) @@ -56,6 +62,12 @@ if(GLOB_TEMP_VAR) endif() set(GLOB_TEMP_VAR) +file(GLOB GLOB_TEMP_VAR /usr/local/lib/qt4/bin/qmake) +if(GLOB_TEMP_VAR) + set(QT4_INSTALLED TRUE) +endif() +set(GLOB_TEMP_VAR) + if (Qt_FIND_VERSION) set(DESIRED_QT_VERSION "${Qt_FIND_VERSION}") endif () @@ -91,6 +103,7 @@ find_file( QT4_QGLOBAL_H_FILE qglobal.h /usr/lib/qt/include/Qt /usr/include/Qt /usr/share/qt4/include/Qt + /usr/local/include/X11/qt4/Qt C:/Progra~1/qt/include/Qt ) if(QT4_QGLOBAL_H_FILE) @@ -110,6 +123,7 @@ find_file( QT3_QGLOBAL_H_FILE qglobal.h /usr/lib/qt/include /usr/include /usr/share/qt3/include + /usr/local/include/X11/qt3 C:/Progra~1/qt/include /usr/include/qt3 ) diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake index 07b6fef..4fc8e40 100644 --- a/Modules/FindQt3.cmake +++ b/Modules/FindQt3.cmake @@ -64,6 +64,7 @@ find_path(QT_INCLUDE_DIR qt.h /usr/share/qt3/include C:/Progra~1/qt/include /usr/include/qt3 + /usr/local/include/X11/qt3 ) # if qglobal.h is not in the qt_include_dir then set @@ -146,7 +147,7 @@ find_library(QT_QASSISTANTCLIENT_LIBRARY # Qt 3 should prefer QTDIR over the PATH find_program(QT_MOC_EXECUTABLE - NAMES moc-qt3 moc + NAMES moc-qt3 moc moc3 moc3-mt HINTS ENV QTDIR PATHS @@ -154,6 +155,7 @@ find_program(QT_MOC_EXECUTABLE "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt" ${GLOB_PATHS_BIN} + /usr/local/lib/qt3 /usr/local/qt /usr/lib/qt /usr/lib/qt3 @@ -170,7 +172,7 @@ endif() # Qt 3 should prefer QTDIR over the PATH find_program(QT_UIC_EXECUTABLE - NAMES uic-qt3 uic + NAMES uic-qt3 uic uic3 uic3-mt HINTS ENV QTDIR PATHS diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index b42247a..013461b 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -982,13 +982,13 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) endif() find_program(QT_MOC_EXECUTABLE - NAMES moc-qt4 moc + NAMES moc-qt4 moc moc4 PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) find_program(QT_UIC_EXECUTABLE - NAMES uic-qt4 uic + NAMES uic-qt4 uic uic4 PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) @@ -1018,13 +1018,13 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) ) find_program(QT_LUPDATE_EXECUTABLE - NAMES lupdate-qt4 lupdate + NAMES lupdate-qt4 lupdate lupdate4 PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) find_program(QT_LRELEASE_EXECUTABLE - NAMES lrelease-qt4 lrelease + NAMES lrelease-qt4 lrelease lrelease4 PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) @@ -1036,13 +1036,13 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) ) find_program(QT_DESIGNER_EXECUTABLE - NAMES designer-qt4 designer + NAMES designer-qt4 designer designer4 PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) find_program(QT_LINGUIST_EXECUTABLE - NAMES linguist-qt4 linguist + NAMES linguist-qt4 linguist linguist4 PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) -- cgit v0.12 From 354ecc1e1f28b9f2412fa015064353c6e20cfe92 Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 5 Dec 2012 13:14:56 -0500 Subject: CMake: Fix dashboard warnings ...in the new file and string TIMESTAMP sub-commands --- Source/cmFileCommand.cxx | 2 +- Source/cmStringCommand.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 42df3a1..0cdbb82 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -3263,7 +3263,7 @@ bool cmFileCommand::HandleTimestampCommand( return false; } - int argsIndex = 1; + unsigned int argsIndex = 1; const std::string& filename = args[argsIndex++]; diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index c402738..e49edd8 100644 --- a/Source/cmStringComman