diff options
-rw-r--r-- | CMakeLists.txt | 8 | ||||
-rw-r--r-- | pylupdate/CMakeLists.txt | 2 | ||||
-rw-r--r-- | pyrcc/CMakeLists.txt | 2 | ||||
-rw-r--r-- | pyrcc/main.cpp | 17 |
4 files changed, 19 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index af33d0f..d328654 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,12 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pyside2-uic GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ) +# on win32 we cannot rely on the shebang for the shell to interpret the pyside2-uic command +if (WIN32) + file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/pyside2-uic.bat "python %~dp0pyside2-uic %*\n") + install (FILES ${CMAKE_CURRENT_BINARY_DIR}/pyside2-uic.bat DESTINATION bin) +endif () + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pyside2uic/__init__.py" DESTINATION "${SITE_PACKAGE}/pyside2uic") install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/pyside2uic @@ -53,7 +59,7 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/pyside2uic PATTERN "*pyside2uic\\__init__.py" EXCLUDE) # Man pages for pyside2-uic -if (NOT win32) +if (NOT WIN32) file(GLOB manpages "${CMAKE_CURRENT_SOURCE_DIR}/pyside2uic/*.1") install(FILES ${manpages} DESTINATION share/man/man1) endif() diff --git a/pylupdate/CMakeLists.txt b/pylupdate/CMakeLists.txt index 83e5bf0..a46608c 100644 --- a/pylupdate/CMakeLists.txt +++ b/pylupdate/CMakeLists.txt @@ -38,7 +38,7 @@ target_link_libraries(pyside2-lupdate install(TARGETS pyside2-lupdate RUNTIME DESTINATION bin) # Man pages -if (NOT win32) +if (NOT WIN32) file(GLOB manpages "${CMAKE_CURRENT_SOURCE_DIR}/*.1") install(FILES ${manpages} DESTINATION share/man/man1) endif() diff --git a/pyrcc/CMakeLists.txt b/pyrcc/CMakeLists.txt index b486e32..2aaf788 100644 --- a/pyrcc/CMakeLists.txt +++ b/pyrcc/CMakeLists.txt @@ -12,7 +12,7 @@ target_link_libraries(pyside2-rcc install(TARGETS pyside2-rcc RUNTIME DESTINATION bin) # Man pages -if (NOT win32) +if (NOT WIN32) file(GLOB manpages "${CMAKE_CURRENT_SOURCE_DIR}/*.1") install(FILES ${manpages} DESTINATION share/man/man1) endif() diff --git a/pyrcc/main.cpp b/pyrcc/main.cpp index aa5ff33..9028e95 100644 --- a/pyrcc/main.cpp +++ b/pyrcc/main.cpp @@ -89,7 +89,7 @@ bool processResourceFile(const QStringList &filenamesIn, const QString &filename return ret; } -int showHelp(const char *argv0, const QString &error) +void showHelp(const char *argv0, const QString &error) { fprintf(stderr, "PySide2 resource compiler\n"); if (!error.isEmpty()) @@ -107,13 +107,12 @@ int showHelp(const char *argv0, const QString &error) " -version Display version\n" " -help Display this information\n", argv0); - return 1; } int main(int argc, char *argv[]) { QString outFilename; - bool helpRequested = false, list = false; + bool list = false; QStringList files; //parse options @@ -163,9 +162,10 @@ int main(int argc, char *argv[]) list = true; } else if(opt == "version") { fprintf(stderr, "Resource Compiler for Qt version %s\n", QT_VERSION_STR); - return 1; + return 0; } else if(opt == "help" || opt == "h") { - helpRequested = true; + showHelp(argv[0], errorMsg); + return 0; } else if(opt == "no-compress") { compressLevel = -2; } else { @@ -180,8 +180,11 @@ int main(int argc, char *argv[]) } } - if (!files.size() || !errorMsg.isEmpty() || helpRequested) - return showHelp(argv[0], errorMsg); + if (!files.size() || !errorMsg.isEmpty()) + { + showHelp(argv[0], errorMsg); + return 1; + } return int(!processResourceFile(files, outFilename, list)); } |