├── .clang-format ├── CREATE_TEST_CERT.bat ├── DISABLE_SECURE_BOOT.md ├── LICENSE ├── MACOS_NO_CERT.md ├── README.md ├── WINDOWS_BOOT_DEBUG.md ├── WINDOWS_DISABLE_DRIVER_SIGNATURE.md ├── WINDOWS_ENABLE_KERNEL_DEBUG.md ├── build.pri ├── build ├── build_dpkg.sh ├── build_linux.sh ├── build_macos.sh ├── build_msvc2013_x86.bat ├── build_msvc2019_x64.bat ├── build_msvc2019_x86.bat ├── build_windows_msvc2013_x86.bat ├── build_windows_msvc2019_x64.bat └── build_windows_msvc2019_x86.bat ├── cmake ├── cpp_standart_setup.cmake ├── create_translation.cmake ├── deploy.cmake ├── deploy_init.cmake ├── deploy_msvc.cmake ├── deploy_openssl.cmake ├── deploy_qt_windows.cmake ├── init_translation.cmake └── macdeployqt.cmake ├── disable_protection.plist ├── enable_powershell.ps1 ├── images ├── Linux_Qt5_15_1.png ├── OSX_Qt5_15_1.png ├── Windows_Qt5_15_1.png └── Windows_Qt5_15_2.png ├── linux.sh ├── mac.sh ├── openssl ├── win_x64 │ ├── libcrypto-1_1-x64.dll │ └── libssl-1_1-x64.dll ├── win_x86 │ ├── libcrypto-1_1.dll │ └── libssl-1_1.dll └── winxp_x86 │ ├── libeay32.dll │ └── ssleay32.dll ├── qt_static_build.ps1 ├── res ├── Info.plist.in ├── resource.rc.in ├── resource_icon.rc.in └── windows.manifest.xml ├── windows.cmd └── windows.manifest.xml /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | # BasedOnStyle: Google 4 | AccessModifierOffset: -4 5 | AlignAfterOpenBracket: Align 6 | AlignArrayOfStructures: None 7 | AlignConsecutiveMacros: None 8 | AlignConsecutiveAssignments: None 9 | AlignConsecutiveBitFields: None 10 | AlignConsecutiveDeclarations: None 11 | AlignEscapedNewlines: Left 12 | AlignOperands: Align 13 | AlignTrailingComments: true 14 | AllowAllArgumentsOnNextLine: true 15 | AllowAllParametersOfDeclarationOnNextLine: true 16 | AllowShortEnumsOnASingleLine: false 17 | AllowShortBlocksOnASingleLine: Never 18 | AllowShortCaseLabelsOnASingleLine: true 19 | AllowShortFunctionsOnASingleLine: None 20 | AllowShortLambdasOnASingleLine: All 21 | AllowShortIfStatementsOnASingleLine: AllIfsAndElse 22 | AllowShortLoopsOnASingleLine: true 23 | AlwaysBreakAfterDefinitionReturnType: None 24 | AlwaysBreakAfterReturnType: None 25 | AlwaysBreakBeforeMultilineStrings: true 26 | AlwaysBreakTemplateDeclarations: Yes 27 | AttributeMacros: 28 | - __capability 29 | BinPackArguments: true 30 | BinPackParameters: true 31 | BraceWrapping: 32 | AfterCaseLabel: false 33 | AfterClass: false 34 | AfterControlStatement: Never 35 | AfterEnum: false 36 | AfterFunction: true 37 | AfterNamespace: false 38 | AfterObjCDeclaration: false 39 | AfterStruct: false 40 | AfterUnion: false 41 | AfterExternBlock: false 42 | BeforeCatch: false 43 | BeforeElse: false 44 | BeforeLambdaBody: false 45 | BeforeWhile: false 46 | IndentBraces: false 47 | SplitEmptyFunction: true 48 | SplitEmptyRecord: true 49 | SplitEmptyNamespace: true 50 | BreakBeforeBinaryOperators: None 51 | BreakBeforeConceptDeclarations: true 52 | BreakBeforeBraces: Custom 53 | BreakBeforeInheritanceComma: false 54 | BreakInheritanceList: BeforeColon 55 | BreakBeforeTernaryOperators: true 56 | BreakConstructorInitializersBeforeComma: false 57 | BreakConstructorInitializers: BeforeColon 58 | BreakAfterJavaFieldAnnotations: false 59 | BreakStringLiterals: true 60 | ColumnLimit: 170 61 | CommentPragmas: '^ IWYU pragma:' 62 | QualifierAlignment: Leave 63 | CompactNamespaces: false 64 | ConstructorInitializerIndentWidth: 4 65 | ContinuationIndentWidth: 4 66 | Cpp11BracedListStyle: true 67 | DeriveLineEnding: true 68 | DerivePointerAlignment: true 69 | DisableFormat: false 70 | EmptyLineAfterAccessModifier: Never 71 | EmptyLineBeforeAccessModifier: LogicalBlock 72 | ExperimentalAutoDetectBinPacking: false 73 | PackConstructorInitializers: NextLine 74 | BasedOnStyle: '' 75 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 76 | AllowAllConstructorInitializersOnNextLine: true 77 | FixNamespaceComments: true 78 | ForEachMacros: 79 | - foreach 80 | - Q_FOREACH 81 | - BOOST_FOREACH 82 | IfMacros: 83 | - KJ_IF_MAYBE 84 | IncludeBlocks: Regroup 85 | IncludeCategories: 86 | - Regex: '^' 87 | Priority: 2 88 | SortPriority: 0 89 | CaseSensitive: false 90 | - Regex: '^<.*\.h>' 91 | Priority: 1 92 | SortPriority: 0 93 | CaseSensitive: false 94 | - Regex: '^<.*' 95 | Priority: 2 96 | SortPriority: 0 97 | CaseSensitive: false 98 | - Regex: '.*' 99 | Priority: 3 100 | SortPriority: 0 101 | CaseSensitive: false 102 | IncludeIsMainRegex: '([-_](test|unittest))?$' 103 | IncludeIsMainSourceRegex: '' 104 | IndentAccessModifiers: false 105 | IndentCaseLabels: true 106 | IndentCaseBlocks: false 107 | IndentGotoLabels: true 108 | IndentPPDirectives: None 109 | IndentExternBlock: AfterExternBlock 110 | IndentRequires: false 111 | IndentWidth: 4 112 | IndentWrappedFunctionNames: false 113 | InsertTrailingCommas: None 114 | JavaScriptQuotes: Leave 115 | JavaScriptWrapImports: true 116 | KeepEmptyLinesAtTheStartOfBlocks: false 117 | LambdaBodyIndentation: Signature 118 | MacroBlockBegin: '' 119 | MacroBlockEnd: '' 120 | MaxEmptyLinesToKeep: 1 121 | NamespaceIndentation: None 122 | ObjCBinPackProtocolList: Never 123 | ObjCBlockIndentWidth: 2 124 | ObjCBreakBeforeNestedBlockParam: true 125 | ObjCSpaceAfterProperty: false 126 | ObjCSpaceBeforeProtocolList: true 127 | PenaltyBreakAssignment: 2 128 | PenaltyBreakBeforeFirstCallParameter: 1 129 | PenaltyBreakComment: 300 130 | PenaltyBreakFirstLessLess: 120 131 | PenaltyBreakOpenParenthesis: 0 132 | PenaltyBreakString: 1000 133 | PenaltyBreakTemplateDeclaration: 10 134 | PenaltyExcessCharacter: 1000000 135 | PenaltyReturnTypeOnItsOwnLine: 200 136 | PenaltyIndentedWhitespace: 0 137 | PointerAlignment: Left 138 | PPIndentWidth: -1 139 | RawStringFormats: 140 | - Language: Cpp 141 | Delimiters: 142 | - cc 143 | - CC 144 | - cpp 145 | - Cpp 146 | - CPP 147 | - 'c++' 148 | - 'C++' 149 | CanonicalDelimiter: '' 150 | BasedOnStyle: google 151 | - Language: TextProto 152 | Delimiters: 153 | - pb 154 | - PB 155 | - proto 156 | - PROTO 157 | EnclosingFunctions: 158 | - EqualsProto 159 | - EquivToProto 160 | - PARSE_PARTIAL_TEXT_PROTO 161 | - PARSE_TEST_PROTO 162 | - PARSE_TEXT_PROTO 163 | - ParseTextOrDie 164 | - ParseTextProtoOrDie 165 | - ParseTestProto 166 | - ParsePartialTestProto 167 | CanonicalDelimiter: pb 168 | BasedOnStyle: google 169 | ReferenceAlignment: Pointer 170 | ReflowComments: true 171 | RemoveBracesLLVM: false 172 | SeparateDefinitionBlocks: Leave 173 | ShortNamespaceLines: 1 174 | SortIncludes: false 175 | SortJavaStaticImport: Before 176 | SortUsingDeclarations: true 177 | SpaceAfterCStyleCast: false 178 | SpaceAfterLogicalNot: false 179 | SpaceAfterTemplateKeyword: true 180 | SpaceBeforeAssignmentOperators: true 181 | SpaceBeforeCaseColon: false 182 | SpaceBeforeCpp11BracedList: false 183 | SpaceBeforeCtorInitializerColon: true 184 | SpaceBeforeInheritanceColon: true 185 | SpaceBeforeParens: ControlStatements 186 | SpaceBeforeParensOptions: 187 | AfterControlStatements: true 188 | AfterForeachMacros: true 189 | AfterFunctionDefinitionName: false 190 | AfterFunctionDeclarationName: false 191 | AfterIfMacros: true 192 | AfterOverloadedOperator: false 193 | BeforeNonEmptyParentheses: false 194 | SpaceAroundPointerQualifiers: Default 195 | SpaceBeforeRangeBasedForLoopColon: true 196 | SpaceInEmptyBlock: false 197 | SpaceInEmptyParentheses: false 198 | SpacesBeforeTrailingComments: 2 199 | SpacesInAngles: Never 200 | SpacesInConditionalStatement: false 201 | SpacesInContainerLiterals: true 202 | SpacesInCStyleCastParentheses: false 203 | SpacesInLineCommentPrefix: 204 | Minimum: 1 205 | Maximum: -1 206 | SpacesInParentheses: false 207 | SpacesInSquareBrackets: false 208 | SpaceBeforeSquareBrackets: false 209 | BitFieldColonSpacing: Both 210 | Standard: Auto 211 | StatementAttributeLikeMacros: 212 | - Q_EMIT 213 | StatementMacros: 214 | - Q_UNUSED 215 | - QT_REQUIRE_VERSION 216 | TabWidth: 4 217 | UseCRLF: false 218 | UseTab: Never 219 | WhitespaceSensitiveMacros: 220 | - STRINGIZE 221 | - PP_STRINGIZE 222 | - BOOST_PP_STRINGIZE 223 | - NS_SWIFT_NAME 224 | - CF_SWIFT_NAME 225 | ... 226 | 227 | -------------------------------------------------------------------------------- /CREATE_TEST_CERT.bat: -------------------------------------------------------------------------------- 1 | rem auto-find makecert.exe util provided that vcvarsXX.bat was executed 2 | "%WindowsSdkVerBinPath%%VSCMD_ARG_TGT_ARCH%\makecert.exe" -r -pe -ss PrivateCertStore -n CN=Windows(TEST) -eku 1.3.6.1.5.5.7.3.3 Test.cer 3 | 4 | rem CertMgr /add Test.cer /s /r localMachine root 5 | rem certmgr -add Test.cer -s -r localMachine TRUSTEDPUBLISHER -------------------------------------------------------------------------------- /DISABLE_SECURE_BOOT.md: -------------------------------------------------------------------------------- 1 | Disabling Secure Boot 2 | ===== 3 | 4 | Find the **Secure Boot** setting in your **BIOS** menu. If possible, set it to **Disabled**. This option is usually in either the **Security** tab, the **Boot** tab, or the **Authentication** tab. 5 | 6 | More info: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/disabling-secure-boot 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-2025 hors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MACOS_NO_CERT.md: -------------------------------------------------------------------------------- 1 | How to run app in macOS that is not signed by a developer 2 | ======= 3 | - Right-click the app(Ctrl + Click). 4 | - Select Open. 5 | - macOS pops up a prompt warning the app is from an unidentified developer. Click Open to continue. 6 | 7 | More info: https://www.macworld.com/article/229130/how-to-install-an-app-in-macos-sierra-thats-not-signed-by-a-developer.html 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Build tools 2 | ======= 3 | Visual Studio Community 2013 with Update 5: https://my.visualstudio.com/Downloads?q=visual%20studio%202013&wt.mc_id=o~msft~vscom~older-downloads (Login with GitHub) 4 | 5 | Visual Studio Community 2017 (version 15.9): https://my.visualstudio.com/Downloads?q=visual%20studio%202017&wt.mc_id=o~msft~vscom~older-downloads (Login with GitHub) 6 | 7 | Visual Studio Community 2019: https://my.visualstudio.com/downloads (Login with GitHub) 8 | 9 | 7-Zip: https://www.7-zip.org/ 10 | 11 | Inno Setup: https://jrsoftware.org/isdl.php 12 | 13 | (Linux)Qt 5.6.3(x64): https://download.qt.io/new_archive/qt/5.6/5.6.3/qt-opensource-linux-x64-5.6.3.run 14 | 15 | (Linux)Qt 5.15.2(x64): https://www.qt.io/download 16 | 17 | (macOS)Qt 5.6.3(x64): https://download.qt.io/new_archive/qt/5.6/5.6.3/qt-opensource-mac-x64-clang-5.6.3.dmg 18 | 19 | (macOS)Qt 5.15.2(x64): https://www.qt.io/download 20 | 21 | (Windows)Qt 5.6.2 for VS2013(x86): https://download.qt.io/new_archive/qt/5.6/5.6.2/qt-opensource-windows-x86-msvc2013-5.6.2.exe 22 | 23 | (Windows)Qt 5.6.2 for VS2013(x64): https://download.qt.io/new_archive/qt/5.6/5.6.2/qt-opensource-windows-x86-msvc2013_64-5.6.2.exe 24 | 25 | (Windows)Qt 5.6.3 for VS2013(x86): https://download.qt.io/new_archive/qt/5.6/5.6.3/qt-opensource-windows-x86-msvc2013-5.6.3.exe 26 | 27 | (Windows)Qt 5.6.3 for VS2013(x64): https://download.qt.io/new_archive/qt/5.6/5.6.3/qt-opensource-windows-x86-msvc2013_64-5.6.3.exe 28 | 29 | (Windows)Qt 5.15.2(x86-x64): https://www.qt.io/download 30 | 31 | UPX: https://github.com/upx/upx/releases 32 | 33 | SQLite tools: https://www.sqlite.org/2018/sqlite-tools-win32-x86-3240000.zip 34 | 35 | WDK 7.1.0 (for Windows XP drivers): https://www.microsoft.com/download/confirmation.aspx?id=11800 36 | 37 | WDK 11 (for Windows 7-11 drivers): https://go.microsoft.com/fwlink/?linkid=2166289 38 | 39 | Windows SDK: https://go.microsoft.com/fwlink/?linkid=2173743 40 | 41 | Install Qt 5.15.2 for Linux https://www.qt.io/download (Downloads for open source users) 42 | 43 | - Desktop gcc 64-bit 44 | - Qt Script 45 | 46 | ![alt text](https://github.com/horsicq/build_tools/blob/master/images/Linux_Qt5_15_1.png "Qt 5.15.1") 47 | 48 | Install Qt 5.15.2 for OSX https://www.qt.io/download (Downloads for open source users) 49 | 50 | - macOS 51 | - Qt Script 52 | 53 | ![alt text](https://github.com/horsicq/build_tools/blob/master/images/OSX_Qt5_15_1.png "Qt 5.15.1") 54 | 55 | Install Qt 5.15.2 for Windows https://www.qt.io/download (Downloads for open source users) 56 | 57 | - MSVC 2019 32-bit 58 | - MSVC 2019 64-bit 59 | - Qt Script 60 | 61 | ![alt text](https://github.com/horsicq/build_tools/blob/master/images/Windows_Qt5_15_1.png "Qt 5.15.1") 62 | -------------------------------------------------------------------------------- /WINDOWS_BOOT_DEBUG.md: -------------------------------------------------------------------------------- 1 | Boot Parameters to Debug the Boot Process in Windows 2 | ===== 3 | 4 | To enable boot debugging, use the **BCDEdit /bootdebug on** command 5 | 6 | More info: https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/boot-parameters-to-enable-debugging 7 | -------------------------------------------------------------------------------- /WINDOWS_DISABLE_DRIVER_SIGNATURE.md: -------------------------------------------------------------------------------- 1 | Disable device driver signing in Windows 2 | ===== 3 | 4 | Before setting BCDEdit options you might need to disable or suspend **BitLocker** and **Secure Boot** on the computer. 5 | 6 | To disable device driver signing: 7 | 8 | - **bcdedit /set nointegritychecks ON** 9 | - **bcdedit /set loadoptions DISABLE_INTEGRITY_CHECKS** 10 | - **bcdedit /set TESTSIGNING ON** 11 | 12 | To enable device driver signing: 13 | 14 | - **bcdedit /set nointegritychecks OFF** 15 | - **bcdedit /set loadoptions DISABLE_INTEGRITY_CHECKS** 16 | - **bcdedit /set TESTSIGNING OFF** 17 | 18 | -------------------------------------------------------------------------------- /WINDOWS_ENABLE_KERNEL_DEBUG.md: -------------------------------------------------------------------------------- 1 | Enable kernel debugging in Windows 2 | ===== 3 | 4 | Before setting **BCDEdit** options you might need to disable or suspend **BitLocker** and **Secure Boot** on the computer. 5 | 6 | **bcdedit /debug on** 7 | 8 | More info: https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/bcdedit--debug 9 | -------------------------------------------------------------------------------- /build.pri: -------------------------------------------------------------------------------- 1 | # For additional build parameters 2 | 3 | CONFIG(debug, debug|release) { 4 | DESTDIR = $$PWD/build/debug 5 | } else { 6 | DESTDIR = $$PWD/build/release 7 | } 8 | # Windows minGW 9 | win32-g++* { 10 | QMAKE_CFLAGS += -Wno-missing-field-initializers 11 | QMAKE_CFLAGS += -Werror=format-security 12 | QMAKE_CFLAGS += -Wno-unused-parameter 13 | QMAKE_CXXFLAGS += -Wno-missing-field-initializers 14 | QMAKE_CXXFLAGS += -Werror=format-security 15 | QMAKE_CXXFLAGS += -Wno-unused-parameter 16 | } 17 | # Linux gcc 18 | unix:!macx { 19 | QMAKE_CFLAGS += -Wno-missing-field-initializers 20 | QMAKE_CFLAGS += -Werror=format-security 21 | QMAKE_CFLAGS += -Wno-unused-parameter 22 | QMAKE_CXXFLAGS += -Wno-missing-field-initializers 23 | QMAKE_CXXFLAGS += -Werror=format-security 24 | QMAKE_CXXFLAGS += -Wno-unused-parameter 25 | } 26 | # macOS clang 27 | unix:macx { 28 | QMAKE_CFLAGS += -Wno-missing-field-initializers 29 | QMAKE_CFLAGS += -Werror=format-security 30 | QMAKE_CFLAGS += -Wno-unused-parameter 31 | QMAKE_CXXFLAGS += -Wno-missing-field-initializers 32 | QMAKE_CXXFLAGS += -Werror=format-security 33 | QMAKE_CXXFLAGS += -Wno-unused-parameter 34 | } 35 | # Windows MSVC TODO check ARM/ARM64 !!! 36 | !contains(QMAKE_TARGET.arch, x86_64) { 37 | win32-msvc2013{ 38 | # VS2013 39 | # Windows XP support 40 | QMAKE_CXXFLAGS += /D_USING_V110_SDK71_ 41 | QMAKE_LFLAGS += /SUBSYSTEM:WINDOWS,5.01 42 | } 43 | win32-msvc{ 44 | # VS2017 45 | # Windows XP support 46 | QMAKE_CXXFLAGS += /D_USING_V110_SDK71_ 47 | QMAKE_LFLAGS += /SUBSYSTEM:WINDOWS,5.01 48 | } 49 | # TODO more MSVC versions 2019 50 | } 51 | 52 | contains(DEFINES, CREATE_PDB) { 53 | QMAKE_CXXFLAGS += /Zi 54 | QMAKE_LFLAGS += /DEBUG 55 | } 56 | -------------------------------------------------------------------------------- /build/build_dpkg.sh: -------------------------------------------------------------------------------- 1 | cd .. 2 | mkdir tmp_build 3 | cd tmp_build 4 | cmake -DCMAKE_BUILD_TYPE=MinSizeRel .. 5 | make 6 | cpack 7 | cd .. 8 | cp -Rf tmp_build/packages . 9 | 10 | -------------------------------------------------------------------------------- /build/build_linux.sh: -------------------------------------------------------------------------------- 1 | cd .. 2 | mkdir tmp_build 3 | cd tmp_build 4 | cmake -DCMAKE_BUILD_TYPE=MinSizeRel .. 5 | make 6 | cpack 7 | cd .. 8 | cp -Rf tmp_build/packages . 9 | 10 | -------------------------------------------------------------------------------- /build/build_macos.sh: -------------------------------------------------------------------------------- 1 | # sudo ~/Qt/Tools/CMake/CMake.app/Contents/bin/cmake-gui --install 2 | cd .. 3 | mkdir tmp_build 4 | cd tmp_build 5 | cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_PREFIX_PATH="~/Qt/5.15.2/clang_64" ./.. 6 | make 7 | cpack 8 | cd .. 9 | cp -Rf tmp_build/packages . 10 | -------------------------------------------------------------------------------- /build/build_msvc2013_x86.bat: -------------------------------------------------------------------------------- 1 | call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86 2 | cd .. 3 | mkdir tmp_build 4 | cd tmp_build 5 | cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_PREFIX_PATH="C:\Qt5.6.3\5.6.3\msvc2013" -G "NMake Makefiles" .. 6 | nmake 7 | cpack 8 | 9 | cd .. 10 | xcopy /y /E tmp_build\packages\ packages\ -------------------------------------------------------------------------------- /build/build_msvc2019_x64.bat: -------------------------------------------------------------------------------- 1 | IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" ( 2 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" x64 3 | ) ELSE ( 4 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 5 | ) 6 | cd .. 7 | mkdir tmp_build 8 | cd tmp_build 9 | cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_PREFIX_PATH="C:\Qt\5.15.2\msvc2019_64" -G "NMake Makefiles" .. 10 | nmake 11 | cpack 12 | 13 | cd .. 14 | xcopy /y /E tmp_build\packages\ packages\ -------------------------------------------------------------------------------- /build/build_msvc2019_x86.bat: -------------------------------------------------------------------------------- 1 | IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" ( 2 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" x86 3 | ) ELSE ( 4 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86 5 | ) 6 | 7 | cd .. 8 | mkdir tmp_build 9 | cd tmp_build 10 | cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_PREFIX_PATH="C:\Qt\5.15.2\msvc2019" -G "NMake Makefiles" .. 11 | nmake 12 | cpack 13 | 14 | cd .. 15 | xcopy /y /E tmp_build\packages\ packages\ -------------------------------------------------------------------------------- /build/build_windows_msvc2013_x86.bat: -------------------------------------------------------------------------------- 1 | call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86 2 | cd .. 3 | mkdir tmp_build 4 | cd tmp_build 5 | cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_PREFIX_PATH="C:\Qt5.6.3\5.6.3\msvc2013" -G "NMake Makefiles" .. 6 | nmake 7 | cpack 8 | 9 | cd .. 10 | xcopy /y /E tmp_build\packages\ packages\ -------------------------------------------------------------------------------- /build/build_windows_msvc2019_x64.bat: -------------------------------------------------------------------------------- 1 | IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" ( 2 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" x64 3 | ) ELSE ( 4 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 5 | ) 6 | cd .. 7 | mkdir tmp_build 8 | cd tmp_build 9 | cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_PREFIX_PATH="C:\Qt\5.15.2\msvc2019_64" -G "NMake Makefiles" .. 10 | nmake 11 | cpack 12 | 13 | cd .. 14 | xcopy /y /E tmp_build\packages\ packages\ -------------------------------------------------------------------------------- /build/build_windows_msvc2019_x86.bat: -------------------------------------------------------------------------------- 1 | IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" ( 2 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" x86 3 | ) ELSE ( 4 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86 5 | ) 6 | 7 | cd .. 8 | mkdir tmp_build 9 | cd tmp_build 10 | cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_PREFIX_PATH="C:\Qt\5.15.2\msvc2019" -G "NMake Makefiles" .. 11 | nmake 12 | cpack 13 | 14 | cd .. 15 | xcopy /y /E tmp_build\packages\ packages\ -------------------------------------------------------------------------------- /cmake/cpp_standart_setup.cmake: -------------------------------------------------------------------------------- 1 | include(GNUInstallDirs) 2 | 3 | set(CMAKE_AUTOUIC ON) 4 | set(CMAKE_AUTOMOC ON) 5 | set(CMAKE_AUTORCC ON) 6 | 7 | set(CMAKE_CXX_STANDARD 14) 8 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 9 | 10 | if(WIN32) 11 | if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") 12 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") 13 | set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO") 14 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO") 15 | endif() 16 | endif() 17 | 18 | if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") 19 | message(STATUS "Using GNU Compiler") 20 | #TODO 21 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 22 | message(STATUS "Using Clang Compiler") 23 | #TODO 24 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") 25 | message(STATUS "Using MSVC Compiler") 26 | #TODO 27 | else () 28 | message(FATAL_ERROR "Compiler: ${CMAKE_CXX_COMPILER_ID}") 29 | endif() 30 | 31 | if(WIN32) 32 | set(X_RESOURCES "./") 33 | elseif(APPLE) 34 | set(X_RESOURCES "./${PROJECT_NAME}.app/Contents/Resources") 35 | else() 36 | set(X_RESOURCES ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}) 37 | endif() 38 | 39 | -------------------------------------------------------------------------------- /cmake/create_translation.cmake: -------------------------------------------------------------------------------- 1 | message("Create translation") 2 | 3 | if(${QT_VERSION_MAJOR} EQUAL 5) 4 | if(${QT_VERSION} VERSION_GREATER_EQUAL 5.6.0) 5 | qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES} OPTIONS -locations none) 6 | add_custom_target(translations DEPENDS ${QM_FILES}) 7 | endif() 8 | endif() 9 | if(${QT_VERSION_MAJOR} EQUAL 6) 10 | qt6_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES} OPTIONS -locations none) 11 | add_custom_target(translations DEPENDS ${QM_FILES}) 12 | endif() 13 | 14 | if (DEFINED X_RESOURCES) 15 | install (FILES ${QM_FILES} DESTINATION "${X_RESOURCES}/lang" OPTIONAL) 16 | endif() 17 | -------------------------------------------------------------------------------- /cmake/deploy.cmake: -------------------------------------------------------------------------------- 1 | function(deploy_init) 2 | set(X_PROJECT_ARCH "x86") 3 | 4 | # x86 architecture detection 5 | if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") 6 | set(X_PROJECT_ARCH "amd64") 7 | elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i[3-6]86" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86") 8 | set(X_PROJECT_ARCH "x86") 9 | 10 | # ARM architecture detection 11 | elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "^arm" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "armv[0-9]") 12 | set(X_PROJECT_ARCH "arm") 13 | elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64") 14 | set(X_PROJECT_ARCH "arm64") 15 | 16 | # Other common architectures 17 | elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "^(powerpc|ppc)64") 18 | set(X_PROJECT_ARCH "ppc64") 19 | elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "^(powerpc|ppc)") 20 | set(X_PROJECT_ARCH "ppc") 21 | elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips") 22 | set(X_PROJECT_ARCH "mips") 23 | elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "riscv") 24 | if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "64") 25 | set(X_PROJECT_ARCH "riscv64") 26 | else() 27 | set(X_PROJECT_ARCH "riscv32") 28 | endif() 29 | else() 30 | message(WARNING "Unknown architecture: ${CMAKE_SYSTEM_PROCESSOR}") 31 | set(X_PROJECT_ARCH "${CMAKE_SYSTEM_PROCESSOR}") 32 | endif() 33 | 34 | message(STATUS X_PROJECT_ARCH: ${X_PROJECT_ARCH}) 35 | 36 | if (WIN32) 37 | if (CMAKE_SIZEOF_VOID_P EQUAL 8) 38 | set(X_PROJECT_OSNAME "win64") 39 | else() 40 | set(X_PROJECT_OSNAME "win32") 41 | endif() 42 | 43 | if(MSVC) 44 | if(${MSVC_VERSION} EQUAL 1800) 45 | set(X_PROJECT_OSNAME "winxp") 46 | set(X_PROJECT_ARCH "x86") 47 | endif() 48 | endif() 49 | endif() 50 | if (CMAKE_SYSTEM_NAME MATCHES "Linux") 51 | execute_process ( 52 | COMMAND bash -c ". /etc/os-release; echo -n $NAME" 53 | OUTPUT_VARIABLE X_OS_NAME 54 | ) 55 | execute_process ( 56 | COMMAND bash -c ". /etc/os-release; echo -n $VERSION_ID" 57 | OUTPUT_VARIABLE X_OS_VERSION 58 | ) 59 | 60 | set(X_PROJECT_OSNAME ${X_OS_NAME}_${X_OS_VERSION}) 61 | message(STATUS X_OS_NAME: ${X_OS_NAME}) 62 | message(STATUS X_OS_VERSION: ${X_OS_VERSION}) 63 | message(STATUS X_PROJECT_OSNAME: ${X_PROJECT_OSNAME}) 64 | 65 | if (EXISTS "/etc/debian_version") 66 | file (STRINGS "/etc/debian_version" X_DEBIAN_VERSION) 67 | message(STATUS "X_DEBIAN_VERSION: ${X_DEBIAN_VERSION}") 68 | if (X_DEBIAN_VERSION MATCHES "squeeze") 69 | set(X_DEBIAN_VERSION "6") 70 | elseif (X_DEBIAN_VERSION MATCHES "squeeze") 71 | set(X_DEBIAN_VERSION "7") 72 | elseif (X_DEBIAN_VERSION MATCHES "squeeze") 73 | set(X_DEBIAN_VERSION "8") 74 | elseif (X_DEBIAN_VERSION MATCHES "squeeze") 75 | set(X_DEBIAN_VERSION "9") 76 | elseif (X_DEBIAN_VERSION MATCHES "squeeze") 77 | set(X_DEBIAN_VERSION "10") 78 | elseif (X_DEBIAN_VERSION MATCHES "squeeze") 79 | set(X_DEBIAN_VERSION "11") 80 | elseif (X_DEBIAN_VERSION MATCHES "bookworm") 81 | set(X_DEBIAN_VERSION "12") 82 | else() 83 | set(X_DEBIAN_VERSION "11") 84 | endif() 85 | 86 | set(X_DEBIAN_VERSION ${X_DEBIAN_VERSION}) 87 | 88 | message(STATUS "X_DEBIAN_VERSION: ${X_DEBIAN_VERSION}") 89 | message(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}") 90 | endif() 91 | endif() 92 | 93 | if(APPLE) 94 | set (CMAKE_OSX_ARCHITECTURES x86_64) # TODO make option 95 | add_compile_options(-Wno-deprecated-declarations) 96 | add_compile_options(-Wno-switch) 97 | endif() 98 | 99 | #set(CPACK_SOURCE_GENERATOR "ZIP") 100 | set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) 101 | set(CPACK_OUTPUT_FILE_PREFIX packages) 102 | set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE") 103 | set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/../README.md") 104 | file (STRINGS "${PROJECT_SOURCE_DIR}/../release_version.txt" CPACK_PACKAGE_VERSION) 105 | set(CPACK_PACKAGE_NAME ${X_PROJECTNAME}) 106 | set(CPACK_PACKAGE_INSTALL_DIRECTORY ${X_PROJECTNAME}) 107 | set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY ${X_PROJECTNAME}) 108 | set(CPACK_PACKAGE_VENDOR ${X_COMPANYNAME}) 109 | set(CPACK_PACKAGE_DESCRIPTION ${X_DESCRIPTION}) 110 | set(CPACK_PACKAGE_HOMEPAGE_URL ${X_HOMEPAGE}) 111 | 112 | if (CMAKE_SYSTEM_NAME MATCHES "Linux") 113 | set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${X_MAINTAINER}) 114 | set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${X_PROJECT_OSNAME}_${X_PROJECT_ARCH}") 115 | message(STATUS CPACK_DEBIAN_PACKAGE_NAME: ${CPACK_DEBIAN_PACKAGE_NAME}) 116 | #set(CPACK_DEBIAN_PACKAGE_SECTION ${X_SECTION}) 117 | endif() 118 | 119 | if (WIN32) 120 | set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${X_PROJECT_OSNAME}_portable_${CPACK_PACKAGE_VERSION}") 121 | endif() 122 | 123 | if (CMAKE_SYSTEM_NAME MATCHES "Linux") 124 | # Qt5 125 | if (NOT "${Qt5Core_VERSION}" STREQUAL "") 126 | if (X_DEBIAN_VERSION LESS 11) 127 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "qt5-default") 128 | endif() 129 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5core5a") 130 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5dbus5") # TODO Check 131 | endif() 132 | if (NOT "${Qt5Gui_VERSION}" STREQUAL "") 133 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5gui5") 134 | endif() 135 | if (NOT "${Qt5Widgets_VERSION}" STREQUAL "") 136 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5widgets5") 137 | endif() 138 | if (NOT "${Qt5Svg_VERSION}" STREQUAL "") 139 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5svg5") 140 | endif() 141 | if (NOT "${Qt5Sql_VERSION}" STREQUAL "") 142 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5sql5") 143 | endif() 144 | if (NOT "${Qt5OpenGL_VERSION}" STREQUAL "") 145 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5opengl5") 146 | endif() 147 | if (NOT "${Qt5Network_VERSION}" STREQUAL "") 148 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5network5") 149 | endif() 150 | if (NOT "${Qt5Script_VERSION}" STREQUAL "") 151 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5script5") 152 | endif() 153 | if (NOT "${Qt5ScriptTools_VERSION}" STREQUAL "") 154 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5scripttools5") 155 | endif() 156 | # Qt6 157 | if (NOT "${Qt6Core_VERSION}" STREQUAL "") 158 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt6core6") 159 | endif() 160 | if (NOT "${Qt6Gui_VERSION}" STREQUAL "") 161 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt6gui6") 162 | endif() 163 | if (NOT "${Qt6Widgets_VERSION}" STREQUAL "") 164 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt6widgets6") 165 | endif() 166 | if (NOT "${Qt6Sql_VERSION}" STREQUAL "") 167 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt6sql6") 168 | endif() 169 | if (NOT "${Qt6Network_VERSION}" STREQUAL "") 170 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt6network6") 171 | endif() 172 | 173 | string(REPLACE ";" ", " CPACK_DEBIAN_PACKAGE_DEPENDS "${X_DEBIAN_PACKAGE_DEPENDS}") 174 | message(STATUS CPACK_DEBIAN_PACKAGE_DEPENDS: ${CPACK_DEBIAN_PACKAGE_DEPENDS}) 175 | endif() 176 | 177 | include(CPack) 178 | 179 | if(WIN32) 180 | configure_file("${PROJECT_SOURCE_DIR}/../res/resource.rc.in" "${PROJECT_SOURCE_DIR}/../res/resource.rc" @ONLY) 181 | endif() 182 | 183 | # get_cmake_property(_variableNames VARIABLES) 184 | # list (SORT _variableNames) 185 | # foreach (_variableName ${_variableNames}) 186 | # message(STATUS "${_variableName}=${${_variableName}}") 187 | # endforeach() 188 | 189 | # foreach(loopVAR IN LISTS PROJECT_SOURCES) 190 | # message("Source from a PROJECT_SOURCES: ${loopVAR}") 191 | # set_property(SOURCE ${loopVAR} PROPERTY COMPILE_OPTIONS ${a_FLAGS}) 192 | # endforeach() 193 | 194 | endfunction() 195 | 196 | function(deploy_msvc) 197 | message(STATUS ${MSVC_TOOLSET_VERSION}) 198 | if(MSVC) 199 | if(${MSVC_TOOLSET_VERSION} GREATER_EQUAL 142) 200 | set(VC_REDIST_DIR $ENV{VCToolsRedistDir}$ENV{Platform}/Microsoft.VC${MSVC_TOOLSET_VERSION}.CRT) 201 | string(REPLACE "\\" "/" VC_REDIST_DIR ${VC_REDIST_DIR}) 202 | message(STATUS ${VC_REDIST_DIR}) 203 | 204 | install (FILES "${VC_REDIST_DIR}/msvcp140.dll" DESTINATION "./" OPTIONAL) 205 | install (FILES "${VC_REDIST_DIR}/msvcp140_1.dll" DESTINATION "./" OPTIONAL) 206 | install (FILES "${VC_REDIST_DIR}/msvcp140_2.dll" DESTINATION "./" OPTIONAL) 207 | install (FILES "${VC_REDIST_DIR}/vcruntime140.dll" DESTINATION "./" OPTIONAL) 208 | install (FILES "${VC_REDIST_DIR}/vcruntime140_1.dll" DESTINATION "./" OPTIONAL) 209 | endif() 210 | endif() 211 | endfunction() 212 | 213 | function(deploy_qt) 214 | message(STATUS qt_version_${QT_VERSION_MAJOR}) 215 | if (WIN32) 216 | if (NOT "${CMAKE_PREFIX_PATH}" STREQUAL "") 217 | string(REPLACE "\\" "/" CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}) 218 | endif() 219 | # Qt5 220 | if (NOT "${Qt5Core_VERSION}" STREQUAL "") 221 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Core.dll" DESTINATION "./" OPTIONAL) 222 | endif() 223 | if (NOT "${Qt5Gui_VERSION}" STREQUAL "") 224 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Gui.dll" DESTINATION "./" OPTIONAL) 225 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/platforms/qwindows.dll" DESTINATION platforms OPTIONAL) 226 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qjpeg.dll" DESTINATION imageformats OPTIONAL) 227 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qtiff.dll" DESTINATION imageformats OPTIONAL) 228 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qico.dll" DESTINATION imageformats OPTIONAL) 229 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qgif.dll" DESTINATION imageformats OPTIONAL) 230 | endif() 231 | if (NOT "${Qt5Widgets_VERSION}" STREQUAL "") 232 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Widgets.dll" DESTINATION "./" OPTIONAL) 233 | endif() 234 | if (NOT "${Qt5OpenGL_VERSION}" STREQUAL "") 235 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5OpenGL.dll" DESTINATION "./" OPTIONAL) 236 | endif() 237 | if (NOT "${Qt5Svg_VERSION}" STREQUAL "") 238 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Svg.dll" DESTINATION "./" OPTIONAL) 239 | endif() 240 | if (NOT "${Qt5Sql_VERSION}" STREQUAL "") 241 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Sql.dll" DESTINATION "./" OPTIONAL) 242 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/sqldrivers/qsqlite.dll" DESTINATION sqldrivers OPTIONAL) 243 | endif() 244 | if (NOT "${Qt5Network_VERSION}" STREQUAL "") 245 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Network.dll" DESTINATION "./" OPTIONAL) 246 | endif() 247 | if (NOT "${Qt5Script_VERSION}" STREQUAL "") 248 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Script.dll" DESTINATION "./" OPTIONAL) 249 | endif() 250 | if (NOT "${Qt5ScriptTools_VERSION}" STREQUAL "") 251 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5ScriptTools.dll" DESTINATION "./" OPTIONAL) 252 | endif() 253 | #Qt6 254 | if (NOT "${Qt6Core_VERSION}" STREQUAL "") 255 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Core.dll" DESTINATION "./" OPTIONAL) 256 | endif() 257 | if (NOT "${Qt6Gui_VERSION}" STREQUAL "") 258 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Gui.dll" DESTINATION "./" OPTIONAL) 259 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/platforms/qwindows.dll" DESTINATION platforms OPTIONAL) 260 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qjpeg.dll" DESTINATION imageformats OPTIONAL) 261 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qsvg.dll" DESTINATION imageformats OPTIONAL) 262 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qico.dll" DESTINATION imageformats OPTIONAL) 263 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qgif.dll" DESTINATION imageformats OPTIONAL) 264 | endif() 265 | if (NOT "${Qt6Widgets_VERSION}" STREQUAL "") 266 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Widgets.dll" DESTINATION "./" OPTIONAL) 267 | endif() 268 | if (NOT "${Qt6OpenGL_VERSION}" STREQUAL "") 269 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6OpenGL.dll" DESTINATION "./" OPTIONAL) 270 | endif() 271 | if (NOT "${Qt6Svg_VERSION}" STREQUAL "") 272 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Svg.dll" DESTINATION "./" OPTIONAL) 273 | endif() 274 | if (NOT "${Qt6Sql_VERSION}" STREQUAL "") 275 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Sql.dll" DESTINATION "./") 276 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/sqldrivers/qsqlite.dll" DESTINATION sqldrivers OPTIONAL) 277 | endif() 278 | if (NOT "${Qt6Network_VERSION}" STREQUAL "") 279 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Network.dll" DESTINATION "./" OPTIONAL) 280 | endif() 281 | if (NOT "${Qt6Qml_VERSION}" STREQUAL "") 282 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Qml.dll" DESTINATION "./" OPTIONAL) 283 | endif() 284 | endif() 285 | endfunction() 286 | -------------------------------------------------------------------------------- /cmake/deploy_init.cmake: -------------------------------------------------------------------------------- 1 | set(X_PROJECT_ARCH ${CMAKE_SYSTEM_PROCESSOR}) 2 | message(STATUS CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}) 3 | message(STATUS X_PROJECT_ARCH: ${X_PROJECT_ARCH}) 4 | 5 | if (WIN32) 6 | if (CMAKE_SIZEOF_VOID_P EQUAL 8) 7 | set(X_PROJECT_OSNAME "win64") 8 | else() 9 | set(X_PROJECT_OSNAME "win32") 10 | endif() 11 | 12 | if(MSVC) 13 | set(X_PROJECT_ARCH $ENV{Platform}) 14 | if(${MSVC_VERSION} EQUAL 1800) 15 | set(X_PROJECT_OSNAME "winxp") 16 | set(X_PROJECT_ARCH "x86") 17 | endif() 18 | endif() 19 | endif() 20 | if (CMAKE_SYSTEM_NAME MATCHES "Linux") 21 | execute_process ( 22 | COMMAND bash -c ". /etc/os-release; echo -n $NAME" 23 | OUTPUT_VARIABLE X_OS_NAME 24 | ) 25 | execute_process ( 26 | COMMAND bash -c ". /etc/os-release; echo -n $VERSION_ID" 27 | OUTPUT_VARIABLE X_OS_VERSION 28 | ) 29 | 30 | set(X_PROJECT_OSNAME ${X_OS_NAME}_${X_OS_VERSION}) 31 | message(STATUS X_OS_NAME: ${X_OS_NAME}) 32 | message(STATUS X_OS_VERSION: ${X_OS_VERSION}) 33 | message(STATUS X_PROJECT_OSNAME: ${X_PROJECT_OSNAME}) 34 | 35 | if (EXISTS "/etc/debian_version") 36 | file (STRINGS "/etc/debian_version" X_DEBIAN_VERSION) 37 | message(STATUS "X_DEBIAN_VERSION: ${X_DEBIAN_VERSION}") 38 | if (X_DEBIAN_VERSION MATCHES "squeeze") 39 | set(X_DEBIAN_VERSION "6") 40 | elseif (X_DEBIAN_VERSION MATCHES "squeeze") 41 | set(X_DEBIAN_VERSION "7") 42 | elseif (X_DEBIAN_VERSION MATCHES "squeeze") 43 | set(X_DEBIAN_VERSION "8") 44 | elseif (X_DEBIAN_VERSION MATCHES "squeeze") 45 | set(X_DEBIAN_VERSION "9") 46 | elseif (X_DEBIAN_VERSION MATCHES "squeeze") 47 | set(X_DEBIAN_VERSION "10") 48 | elseif (X_DEBIAN_VERSION MATCHES "squeeze") 49 | set(X_DEBIAN_VERSION "11") 50 | elseif (X_DEBIAN_VERSION MATCHES "bookworm") 51 | set(X_DEBIAN_VERSION "12") 52 | else() 53 | set(X_DEBIAN_VERSION "11") 54 | endif() 55 | 56 | set(X_DEBIAN_VERSION ${X_DEBIAN_VERSION}) 57 | 58 | message(STATUS "X_DEBIAN_VERSION: ${X_DEBIAN_VERSION}") 59 | message(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}") 60 | endif() 61 | endif() 62 | 63 | if(APPLE) 64 | set(X_PROJECT_OSNAME "macOS") 65 | set (CMAKE_OSX_ARCHITECTURES x86_64) # TODO make option 66 | set (X_PROJECT_ARCH x86_64) 67 | add_compile_options(-Wno-deprecated-declarations) 68 | add_compile_options(-Wno-switch) 69 | set(X_MACOS_ICON "${PROJECT_SOURCE_DIR}/../res/main.icns") 70 | set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") 71 | endif() 72 | 73 | configure_file("${PROJECT_SOURCE_DIR}/../LICENSE" "${PROJECT_SOURCE_DIR}/../res/license.txt" @ONLY) 74 | 75 | if(NOT EXISTS "${PROJECT_SOURCE_DIR}/../res/readme.txt") 76 | configure_file("${PROJECT_SOURCE_DIR}/../README.md" "${PROJECT_SOURCE_DIR}/../res/readme.txt" @ONLY) 77 | endif() 78 | 79 | set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) 80 | set(CPACK_OUTPUT_FILE_PREFIX packages) 81 | set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../res/license.txt") 82 | set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/../res/readme.txt") 83 | file (STRINGS "${PROJECT_SOURCE_DIR}/../release_version.txt" CPACK_PACKAGE_VERSION) 84 | set(CPACK_PACKAGE_NAME ${X_PROJECTNAME}) 85 | set(CPACK_PACKAGE_INSTALL_DIRECTORY ${X_PROJECTNAME}) 86 | set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY ${X_PROJECTNAME}) 87 | set(CPACK_PACKAGE_VENDOR ${X_COMPANYNAME}) 88 | set(CPACK_PACKAGE_DESCRIPTION ${X_DESCRIPTION}) 89 | set(CPACK_PACKAGE_HOMEPAGE_URL ${X_HOMEPAGE}) 90 | 91 | if (WIN32) 92 | set(CPACK_SOURCE_GENERATOR "ZIP") 93 | set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${X_PROJECT_OSNAME}_portable_${CPACK_PACKAGE_VERSION}_${X_PROJECT_ARCH}") 94 | endif() 95 | 96 | if (CMAKE_SYSTEM_NAME MATCHES "Linux") 97 | set(X_DEB_ARCH ${X_PROJECT_ARCH}) 98 | 99 | # Standard mappings between CMake and Debian architectures 100 | if(X_PROJECT_ARCH STREQUAL "x86_64") 101 | set(X_DEB_ARCH "amd64") 102 | elseif(X_PROJECT_ARCH MATCHES "^i[3456]86$") 103 | set(X_DEB_ARCH "i386") 104 | elseif(X_PROJECT_ARCH MATCHES "^armv7") 105 | set(X_DEB_ARCH "armhf") 106 | elseif(X_PROJECT_ARCH STREQUAL "aarch64") 107 | set(X_DEB_ARCH "arm64") 108 | elseif(X_PROJECT_ARCH STREQUAL "ppc64le") 109 | set(X_DEB_ARCH "ppc64el") 110 | endif() 111 | 112 | set(CPACK_SOURCE_GENERATOR "TGZ;DEB") 113 | set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${X_MAINTAINER}) 114 | set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${X_PROJECT_OSNAME}_${X_PROJECT_ARCH}") 115 | set(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${X_PROJECT_OSNAME}_${X_DEB_ARCH}") 116 | message(STATUS CPACK_DEBIAN_PACKAGE_NAME: ${CPACK_DEBIAN_PACKAGE_NAME}) 117 | #set(CPACK_DEBIAN_PACKAGE_SECTION ${X_SECTION}) 118 | 119 | # Qt5 120 | if (NOT "${Qt5Core_VERSION}" STREQUAL "") 121 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5core5a") 122 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5dbus5") # TODO Check 123 | endif() 124 | if (NOT "${Qt5Gui_VERSION}" STREQUAL "") 125 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5gui5") 126 | endif() 127 | if (NOT "${Qt5Widgets_VERSION}" STREQUAL "") 128 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5widgets5") 129 | endif() 130 | if (NOT "${Qt5Svg_VERSION}" STREQUAL "") 131 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5svg5") 132 | endif() 133 | if (NOT "${Qt5Sql_VERSION}" STREQUAL "") 134 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5sql5") 135 | endif() 136 | if (NOT "${Qt5OpenGL_VERSION}" STREQUAL "") 137 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5opengl5") 138 | endif() 139 | if (NOT "${Qt5Network_VERSION}" STREQUAL "") 140 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5network5") 141 | endif() 142 | if (NOT "${Qt5Script_VERSION}" STREQUAL "") 143 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5script5") 144 | endif() 145 | if (NOT "${Qt5ScriptTools_VERSION}" STREQUAL "") 146 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt5scripttools5") 147 | endif() 148 | # Qt6 149 | if (NOT "${Qt6Core_VERSION}" STREQUAL "") 150 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt6core6") 151 | endif() 152 | if (NOT "${Qt6Gui_VERSION}" STREQUAL "") 153 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt6gui6") 154 | endif() 155 | if (NOT "${Qt6Widgets_VERSION}" STREQUAL "") 156 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt6widgets6") 157 | endif() 158 | if (NOT "${Qt6Sql_VERSION}" STREQUAL "") 159 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt6sql6") 160 | endif() 161 | if (NOT "${Qt6Network_VERSION}" STREQUAL "") 162 | list(APPEND X_DEBIAN_PACKAGE_DEPENDS "libqt6network6") 163 | endif() 164 | 165 | string(REPLACE ";" ", " CPACK_DEBIAN_PACKAGE_DEPENDS "${X_DEBIAN_PACKAGE_DEPENDS}") 166 | message(STATUS CPACK_DEBIAN_PACKAGE_DEPENDS: ${CPACK_DEBIAN_PACKAGE_DEPENDS}) 167 | endif() 168 | 169 | if(APPLE) 170 | configure_file("${PROJECT_SOURCE_DIR}/../res/Info.plist.in" "${PROJECT_SOURCE_DIR}/../res/Info.plist" @ONLY) 171 | 172 | set(CPACK_GENERATOR "Bundle;productbuild;ZIP") 173 | set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${X_PROJECT_OSNAME}_${X_PROJECT_ARCH}") 174 | set(CPACK_BUNDLE_NAME ${X_PROJECTNAME}) 175 | set(CPACK_BUNDLE_ICON ${X_MACOS_ICON}) 176 | set(CPACK_BUNDLE_PLIST "${PROJECT_SOURCE_DIR}/../res/Info.plist") 177 | set(CPACK_PRODUCTBUILD_IDENTIFIER ${BUNDLE_ID_OPTION}) 178 | endif() 179 | 180 | include(CPack) 181 | 182 | if(WIN32) 183 | configure_file("${PROJECT_SOURCE_DIR}/../res/resource.rc.in" "${PROJECT_SOURCE_DIR}/../res/resource.rc" @ONLY) 184 | configure_file("${PROJECT_SOURCE_DIR}/../res/resource_icon.rc.in" "${PROJECT_SOURCE_DIR}/../res/resource_icon.rc" @ONLY) 185 | endif() 186 | 187 | # get_cmake_property(_variableNames VARIABLES) 188 | # list (SORT _variableNames) 189 | # foreach (_variableName ${_variableNames}) 190 | # message(STATUS "${_variableName}=${${_variableName}}") 191 | # endforeach() 192 | 193 | # foreach(loopVAR IN LISTS PROJECT_SOURCES) 194 | # message("Source from a PROJECT_SOURCES: ${loopVAR}") 195 | # set_property(SOURCE ${loopVAR} PROPERTY COMPILE_OPTIONS ${a_FLAGS}) 196 | # endforeach() 197 | -------------------------------------------------------------------------------- /cmake/deploy_msvc.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS ${MSVC_TOOLSET_VERSION}) 2 | if(MSVC) 3 | # Check if the Visual Studio version is 12.0 (Visual Studio 2013) 4 | if(CMAKE_GENERATOR MATCHES "Visual Studio 12 2013") 5 | set(VC_REDIST_DIR $ENV{VCINSTALLDIR}/redist/x86/Microsoft.VC120.CRT) 6 | string(REPLACE "\\" "/" VC_REDIST_DIR ${VC_REDIST_DIR}) 7 | message(STATUS ${VC_REDIST_DIR}) 8 | 9 | install(FILES "${VC_REDIST_DIR}/msvcp120.dll" DESTINATION "./" OPTIONAL) 10 | install(FILES "${VC_REDIST_DIR}/msvcr120.dll" DESTINATION "./" OPTIONAL) 11 | endif() 12 | 13 | if(${MSVC_TOOLSET_VERSION} GREATER_EQUAL 142) 14 | set(VC_REDIST_DIR $ENV{VCToolsRedistDir}$ENV{Platform}/Microsoft.VC${MSVC_TOOLSET_VERSION}.CRT) 15 | string(REPLACE "\\" "/" VC_REDIST_DIR ${VC_REDIST_DIR}) 16 | message(STATUS ${VC_REDIST_DIR}) 17 | 18 | install (FILES "${VC_REDIST_DIR}/msvcp140.dll" DESTINATION "./" OPTIONAL) 19 | install (FILES "${VC_REDIST_DIR}/msvcp140_1.dll" DESTINATION "./" OPTIONAL) 20 | install (FILES "${VC_REDIST_DIR}/msvcp140_2.dll" DESTINATION "./" OPTIONAL) 21 | install (FILES "${VC_REDIST_DIR}/vcruntime140.dll" DESTINATION "./" OPTIONAL) 22 | install (FILES "${VC_REDIST_DIR}/vcruntime140_1.dll" DESTINATION "./" OPTIONAL) 23 | endif() 24 | endif() 25 | -------------------------------------------------------------------------------- /cmake/deploy_openssl.cmake: -------------------------------------------------------------------------------- 1 | if(MSVC) 2 | if(${MSVC_VERSION} EQUAL 1800) 3 | install (FILES "${CMAKE_CURRENT_LIST_DIR}/../openssl/winxp_x86/libeay32.dll" DESTINATION "./" OPTIONAL) 4 | install (FILES "${CMAKE_CURRENT_LIST_DIR}/../openssl/winxp_x86/ssleay32.dll" DESTINATION "./" OPTIONAL) 5 | else() 6 | if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86") 7 | install (FILES "${CMAKE_CURRENT_LIST_DIR}/../openssl/win_x86/libcrypto-1_1.dll" DESTINATION "./" OPTIONAL) 8 | install (FILES "${CMAKE_CURRENT_LIST_DIR}/../openssl/win_x86/libssl-1_1.dll" DESTINATION "./" OPTIONAL) 9 | elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64") 10 | install (FILES "${CMAKE_CURRENT_LIST_DIR}/../openssl/win_x64/libcrypto-1_1-x64.dll" DESTINATION "./" OPTIONAL) 11 | install (FILES "${CMAKE_CURRENT_LIST_DIR}/../openssl/win_x64/libssl-1_1-x64.dll" DESTINATION "./" OPTIONAL) 12 | endif() 13 | endif() 14 | endif() 15 | -------------------------------------------------------------------------------- /cmake/deploy_qt_windows.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS qt_version_${QT_VERSION_MAJOR}) 2 | if (WIN32) 3 | string(REPLACE "\\" "/" CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}) 4 | # Qt5 5 | if (NOT "${Qt5Core_VERSION}" STREQUAL "") 6 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Core.dll" DESTINATION "./" OPTIONAL) 7 | endif() 8 | if (NOT "${Qt5Gui_VERSION}" STREQUAL "") 9 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Gui.dll" DESTINATION "./" OPTIONAL) 10 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/platforms/qwindows.dll" DESTINATION "platforms" OPTIONAL) 11 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qjpeg.dll" DESTINATION "imageformats" OPTIONAL) 12 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qtiff.dll" DESTINATION "imageformats" OPTIONAL) 13 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qico.dll" DESTINATION "imageformats" OPTIONAL) 14 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qgif.dll" DESTINATION "imageformats" OPTIONAL) 15 | endif() 16 | if (NOT "${Qt5Widgets_VERSION}" STREQUAL "") 17 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Widgets.dll" DESTINATION "./" OPTIONAL) 18 | endif() 19 | if (NOT "${Qt5OpenGL_VERSION}" STREQUAL "") 20 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5OpenGL.dll" DESTINATION "./" OPTIONAL) 21 | endif() 22 | if (NOT "${Qt5Svg_VERSION}" STREQUAL "") 23 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Svg.dll" DESTINATION "./" OPTIONAL) 24 | endif() 25 | if (NOT "${Qt5Sql_VERSION}" STREQUAL "") 26 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Sql.dll" DESTINATION "./" OPTIONAL) 27 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/sqldrivers/qsqlite.dll" DESTINATION "sqldrivers" OPTIONAL) 28 | endif() 29 | if (NOT "${Qt5Network_VERSION}" STREQUAL "") 30 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Network.dll" DESTINATION "./" OPTIONAL) 31 | endif() 32 | if (NOT "${Qt5Script_VERSION}" STREQUAL "") 33 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5Script.dll" DESTINATION "./" OPTIONAL) 34 | endif() 35 | if (NOT "${Qt5ScriptTools_VERSION}" STREQUAL "") 36 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt5ScriptTools.dll" DESTINATION "./" OPTIONAL) 37 | endif() 38 | #Qt6 39 | if (NOT "${Qt6Core_VERSION}" STREQUAL "") 40 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Core.dll" DESTINATION "./" OPTIONAL) 41 | endif() 42 | if (NOT "${Qt6Gui_VERSION}" STREQUAL "") 43 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Gui.dll" DESTINATION "./" OPTIONAL) 44 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/platforms/qwindows.dll" DESTINATION "platforms" OPTIONAL) 45 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qjpeg.dll" DESTINATION "imageformats" OPTIONAL) 46 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qsvg.dll" DESTINATION "imageformats" OPTIONAL) 47 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qico.dll" DESTINATION "imageformats" OPTIONAL) 48 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/imageformats/qgif.dll" DESTINATION "imageformats" OPTIONAL) 49 | endif() 50 | if (NOT "${Qt6Widgets_VERSION}" STREQUAL "") 51 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Widgets.dll" DESTINATION "./" OPTIONAL) 52 | endif() 53 | if (NOT "${Qt6OpenGL_VERSION}" STREQUAL "") 54 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6OpenGL.dll" DESTINATION "./" OPTIONAL) 55 | endif() 56 | if (NOT "${Qt6Svg_VERSION}" STREQUAL "") 57 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Svg.dll" DESTINATION "./" OPTIONAL) 58 | endif() 59 | if (NOT "${Qt6Sql_VERSION}" STREQUAL "") 60 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Sql.dll" DESTINATION "./") 61 | install (FILES "${CMAKE_PREFIX_PATH}/plugins/sqldrivers/qsqlite.dll" DESTINATION "sqldrivers" OPTIONAL) 62 | endif() 63 | if (NOT "${Qt6Network_VERSION}" STREQUAL "") 64 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Network.dll" DESTINATION "./" OPTIONAL) 65 | endif() 66 | if (NOT "${Qt6Qml_VERSION}" STREQUAL "") 67 | install (FILES "${CMAKE_PREFIX_PATH}/bin/Qt6Qml.dll" DESTINATION "./" OPTIONAL) 68 | endif() 69 | endif() 70 | -------------------------------------------------------------------------------- /cmake/init_translation.cmake: -------------------------------------------------------------------------------- 1 | message("Init translation") 2 | 3 | set(TS_FILES 4 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_ar_AR.ts 5 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_bn_BN.ts 6 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_de_DE.ts 7 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_es_ES.ts 8 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_fa_FA.ts 9 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_fr_FR.ts 10 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_he_IL.ts 11 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_id_ID.ts 12 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_it_IT.ts 13 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_ja_JP.ts 14 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_ko_KR.ts 15 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_pl_PL.ts 16 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_pt_BR.ts 17 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_pt_PT.ts 18 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_ru_RU.ts 19 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_sv_SE.ts 20 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_tr_TR.ts 21 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_uk_UA.ts 22 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_vi_VN.ts 23 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_zh_CN.ts 24 | ${CMAKE_CURRENT_SOURCE_DIR}/translation/${X_ORIGINAL_FILENAME}_zh_TW.ts 25 | ) 26 | -------------------------------------------------------------------------------- /cmake/macdeployqt.cmake: -------------------------------------------------------------------------------- 1 | message("macdeployqt") 2 | 3 | find_program(MACDEPLOYQT NAMES macdeployqt) 4 | if(MACDEPLOYQT) 5 | add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD 6 | COMMAND ${MACDEPLOYQT} "$" 7 | COMMENT "Macdeployqt the executable" 8 | ) 9 | else() 10 | message("macdeployqt not found. Please install Qt tools") 11 | endif() 12 | -------------------------------------------------------------------------------- /disable_protection.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.cs.disable-executable-page-protection 6 | 7 | 8 | -------------------------------------------------------------------------------- /enable_powershell.ps1: -------------------------------------------------------------------------------- 1 | # Get-ExecutionPolicy 2 | Set-ExecutionPolicy -ExecutionPolicy Unrestricted -------------------------------------------------------------------------------- /images/Linux_Qt5_15_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/build_tools/bba0bd0ba87c455c4cf4b357dc7d95c3b466e13a/images/Linux_Qt5_15_1.png -------------------------------------------------------------------------------- /images/OSX_Qt5_15_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/build_tools/bba0bd0ba87c455c4cf4b357dc7d95c3b466e13a/images/OSX_Qt5_15_1.png -------------------------------------------------------------------------------- /images/Windows_Qt5_15_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/build_tools/bba0bd0ba87c455c4cf4b357dc7d95c3b466e13a/images/Windows_Qt5_15_1.png -------------------------------------------------------------------------------- /images/Windows_Qt5_15_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/build_tools/bba0bd0ba87c455c4cf4b357dc7d95c3b466e13a/images/Windows_Qt5_15_2.png -------------------------------------------------------------------------------- /linux.sh: -------------------------------------------------------------------------------- 1 | function check_file 2 | { 3 | if test -f "$1"; then 4 | echo "Check file $1: TRUE" 5 | else 6 | export X_ERROR="true" 7 | echo "Cannot find file: $1" 8 | fi 9 | } 10 | 11 | function make_init 12 | { 13 | export X_REVISION=$(date "+%Y%m%d") 14 | 15 | X_ARCHITECTURE=$(dpkg --print-architecture) 16 | 17 | export X_ARCHITECTURE 18 | 19 | if command -v lsb_release &>/dev/null; then 20 | X_OS_NAME=$(lsb_release -is) 21 | X_OS_NUMBER=$(lsb_release -rs) 22 | else 23 | X_OS_NAME=$(sed -nE 's/^ID=(\S+)$/\1/p' /etc/os-release) 24 | X_OS_NUMBER=$(sed -nE 's/^VERSION_ID="?([-0-9a-z._]+)"?$/\1/p' /etc/os-release) 25 | fi 26 | 27 | export X_OS_VERSION=${X_OS_NAME}_${X_OS_NUMBER} 28 | export X_QT_VERSION=$($QMAKE_PATH -query QT_VERSION) 29 | export X_QT_INSTALL_BINS=$($QMAKE_PATH -query QT_INSTALL_BINS) 30 | export X_QT_INSTALL_PLUGINS=$($QMAKE_PATH -query QT_INSTALL_PLUGINS) 31 | export X_QT_INSTALL_LIBS=$($QMAKE_PATH -query QT_INSTALL_LIBS) 32 | export X_QMAKE_SPEC=$($QMAKE_PATH -query QMAKE_SPEC) 33 | mkdir -p "$X_SOURCE_PATH/release" 34 | mkdir -p "$X_SOURCE_PATH/release/$X_BUILD_NAME" 35 | 36 | # get DEBIAN version 37 | # TODO other Linuxes 38 | 39 | X_DEBIAN_VERSION="$X_OS_NUMBER" 40 | 41 | echo "$X_DEBIAN_VERSION" 42 | 43 | export X_DEBIAN_VERSION 44 | 45 | cp -f $X_SOURCE_PATH/build_tools/build.pri $X_SOURCE_PATH/ 46 | } 47 | 48 | function make_build 49 | { 50 | if test -f "Makefile"; then 51 | make clean 52 | fi 53 | 54 | $QMAKE_PATH "$1" -spec $X_QMAKE_SPEC 55 | make -f Makefile 56 | } 57 | 58 | function make_translate 59 | { 60 | "$X_QT_INSTALL_BINS/lupdate" $1 61 | "$X_QT_INSTALL_BINS/lrelease" $1 62 | # TODO copy 63 | } 64 | 65 | function make_release 66 | { 67 | # TODO 68 | echo "make_release" 69 | } 70 | 71 | function create_deb_app_dir 72 | { 73 | mkdir -p $X_SOURCE_PATH/release/$X_BUILD_NAME/DEBIAN 74 | mkdir -p $X_SOURCE_PATH/release/$X_BUILD_NAME/usr 75 | mkdir -p $X_SOURCE_PATH/release/$X_BUILD_NAME/usr/bin 76 | mkdir -p $X_SOURCE_PATH/release/$X_BUILD_NAME/usr/lib 77 | mkdir -p $X_SOURCE_PATH/release/$X_BUILD_NAME/usr/lib/$1 78 | mkdir -p $X_SOURCE_PATH/release/$X_BUILD_NAME/usr/lib/$1/lang 79 | mkdir -p $X_SOURCE_PATH/release/$X_BUILD_NAME/usr/share 80 | mkdir -p $X_SOURCE_PATH/release/$X_BUILD_NAME/usr/share/applications 81 | mkdir -p $X_SOURCE_PATH/release/$X_BUILD_NAME/usr/share/icons 82 | mkdir -p $X_SOURCE_PATH/release/$X_BUILD_NAME/usr/share/metainfo 83 | } 84 | 85 | function create_deb_control 86 | { 87 | { 88 | if [ -n "$X_PACKAGENAME" ]; then 89 | echo "Package: $X_PACKAGENAME" 90 | fi 91 | if [ -n "$X_RELEASE_VERSION" ]; then 92 | echo "Version: $X_RELEASE_VERSION" 93 | fi 94 | if [ -n "$X_PRIORITY" ]; then 95 | echo "Priority: $X_PRIORITY" 96 | fi 97 | if [ -n "$X_SECTION" ]; then 98 | echo "Section: $X_SECTION" 99 | fi 100 | if [ -n "$X_ARCHITECTURE" ]; then 101 | echo "Architecture: $X_ARCHITECTURE" 102 | fi 103 | if [ -n "$X_MAINTAINER" ]; then 104 | echo "Maintainer: $X_MAINTAINER" 105 | fi 106 | echo "Installed-Size: $(du -sk --exclude $X_SOURCE_PATH/release/$X_BUILD_NAME/DEBIAN $X_SOURCE_PATH/release/$X_BUILD_NAME | cut -f 1)" 107 | if [ -n "$X_DEPENDS" ]; then 108 | echo "Depends: $X_DEPENDS" 109 | fi 110 | if [ -n "$X_HOMEPAGE" ]; then 111 | echo "Homepage: $X_HOMEPAGE" 112 | fi 113 | if [ -n "$X_DESCRIPTION" ]; then 114 | echo "Description: $X_DESCRIPTION" 115 | fi 116 | } > $1 117 | } 118 | 119 | function create_image_app_dir 120 | { 121 | mkdir -p $X_SOURCE_PATH/release/appDir 122 | mkdir -p $X_SOURCE_PATH/release/appDir/usr 123 | mkdir -p $X_SOURCE_PATH/release/appDir/usr/bin 124 | mkdir -p $X_SOURCE_PATH/release/appDir/usr/lib 125 | mkdir -p $X_SOURCE_PATH/release/appDir/usr/lib/$1 126 | mkdir -p $X_SOURCE_PATH/release/appDir/usr/lib/$1/lang 127 | mkdir -p $X_SOURCE_PATH/release/appDir/usr/share 128 | mkdir -p $X_SOURCE_PATH/release/appDir/usr/share/applications 129 | mkdir -p $X_SOURCE_PATH/release/appDir/usr/share/icons 130 | mkdir -p $X_SOURCE_PATH/release/appDir/usr/share/metainfo 131 | } 132 | 133 | function create_run_shell 134 | { 135 | { 136 | echo "#!/bin/sh" 137 | echo 'CWD=$(dirname $0)' 138 | echo 'export LD_LIBRARY_PATH="$CWD/base:$LD_LIBRARY_PATH"' 139 | echo "\$CWD/base/$2 \$*" 140 | } > $1 141 | 142 | chmod +x $1 143 | } 144 | 145 | function make_deb 146 | { 147 | dpkg -b $X_SOURCE_PATH/release/$X_BUILD_NAME 148 | } 149 | 150 | function make_rpm 151 | { 152 | # TODO 153 | echo "make_rpm" 154 | } 155 | 156 | function make_targz 157 | { 158 | tar -cvf $2.tar $1 159 | gzip --best $2.tar 160 | } 161 | 162 | function make_clear 163 | { 164 | rm -rf $X_SOURCE_PATH/release/$X_BUILD_NAME 165 | } 166 | -------------------------------------------------------------------------------- /mac.sh: -------------------------------------------------------------------------------- 1 | function check_file 2 | { 3 | if test -f "$1"; then 4 | echo "Check file $1: TRUE" 5 | else 6 | export X_ERROR="true" 7 | echo "Cannot find file: $1" 8 | fi 9 | } 10 | 11 | function make_init 12 | { 13 | export X_ARCHITECTURE="x86_64" 14 | export X_QT_VERSION=$($QMAKE_PATH -query QT_VERSION) 15 | export X_QT_INSTALL_BINS=$($QMAKE_PATH -query QT_INSTALL_BINS) 16 | export X_QT_INSTALL_PLUGINS=$($QMAKE_PATH -query QT_INSTALL_PLUGINS) 17 | export X_QT_INSTALL_LIBS=$($QMAKE_PATH -query QT_INSTALL_LIBS) 18 | export X_QMAKE_SPEC=$($QMAKE_PATH -query QMAKE_SPEC) 19 | export X_OS_VERSION=$(sw_vers -productVersion) 20 | 21 | # TODO!!! 22 | # mb Check macos/clang 23 | if [[ "$X_QT_VERSION" == "5.15.2" ]]; then 24 | export X_ARCHITECTURE="x86_64" 25 | else 26 | export X_ARCHITECTURE=$(uname -m) # Qt6 27 | fi 28 | 29 | mkdir -p "$X_SOURCE_PATH/release" 30 | mkdir -p "$X_SOURCE_PATH/release/$X_BUILD_NAME" 31 | 32 | cp -f $X_SOURCE_PATH/build_tools/build.pri $X_SOURCE_PATH/ 33 | } 34 | 35 | function make_build 36 | { 37 | if test -f "Makefile"; then 38 | make clean 39 | fi 40 | 41 | $QMAKE_PATH "$1" -spec $X_QMAKE_SPEC CONFIG+=x86_64 CONFIG+=release 42 | make -f Makefile 43 | } 44 | 45 | function make_translate 46 | { 47 | "$X_QT_INSTALL_BINS/lupdate" $1 48 | "$X_QT_INSTALL_BINS/lrelease" $1 49 | mkdir -p "$X_SOURCE_PATH/release/$X_BUILD_NAME/$2.app/Contents/Resources/lang" 50 | mv translation/*.qm "$X_SOURCE_PATH/release/$X_BUILD_NAME/$2.app/Contents/Resources/lang/" 51 | } 52 | 53 | function make_release 54 | { 55 | # TODO make dmg function 56 | #rm -rf $X_SOURCE_PATH/release/${X_BUILD_NAME}_${X_RELEASE_VERSION}.dmg 57 | #hdiutil create -format UDBZ -quiet -srcfolder $X_SOURCE_PATH/release/$BUILD_NAME $X_SOURCE_PATH/release/${X_BUILD_NAME}_${X_RELEASE_VERSION}.dmg 58 | 59 | #if [ -n "$X_PRIVATE_CERT_APP" ]; then 60 | # codesign --deep -f -v -s "$X_PRIVATE_CERT_APP" -o runtime $X_SOURCE_PATH/release/${X_BUILD_NAME}/$1.app 61 | #fi 62 | 63 | cd $X_SOURCE_PATH/release/ 64 | rm -rf $X_SOURCE_PATH/release/${X_BUILD_NAME}_portable_${X_RELEASE_VERSION}_${X_ARCHITECTURE}.zip 65 | /usr/bin/ditto -c -k --sequesterRsrc --keepParent $X_SOURCE_PATH/release/${X_BUILD_NAME}/$1.app $X_SOURCE_PATH/release/${X_BUILD_NAME}_portable_${X_RELEASE_VERSION}_${X_ARCHITECTURE}.zip 66 | 67 | if [ -n "$X_PRIVATE_CERT_INSTALL" ]; then 68 | pkgbuild --analyze --root $X_SOURCE_PATH/release/${X_BUILD_NAME}/$1.app $X_SOURCE_PATH/release/${X_BUILD_NAME}/$1.plist 69 | pkgbuild --root $X_SOURCE_PATH/release/${X_BUILD_NAME}/$1.app --component-plist $X_SOURCE_PATH/release/${X_BUILD_NAME}/$1.plist $X_SOURCE_PATH/release/${X_BUILD_NAME}_${X_RELEASE_VERSION}_${X_ARCHITECTURE}.pkg --sign "$X_PRIVATE_CERT_INSTALL" --identifier $X_PRIVATE_NOTARIZE_BUNDLE --install-location /Applications/$1.app 70 | fi 71 | 72 | zip -d $X_SOURCE_PATH/release/${X_BUILD_NAME}_portable_${X_RELEASE_VERSION}_${X_ARCHITECTURE}.zip __MACOSX/\* 73 | 74 | if [ -n "$X_PRIVATE_NOTARIZE_PWD" ]; then 75 | if [[ "$X_OS_VERSION" == "10.13.6" ]]; then 76 | xcrun altool --notarize-app -f $X_SOURCE_PATH/release/${X_BUILD_NAME}_portable_${X_RELEASE_VERSION}_${X_ARCHITECTURE}.zip --primary-bundle $X_PRIVATE_NOTARIZE_BUNDLE -u ${X_PRIVATE_NOTARIZE_LOGIN} -p ${X_PRIVATE_NOTARIZE_PWD} 77 | xcrun altool --notarize-app -f $X_SOURCE_PATH/release/${X_BUILD_NAME}_${X_RELEASE_VERSION}_${X_ARCHITECTURE}.pkg --primary-bundle $X_PRIVATE_NOTARIZE_BUNDLE -u ${X_PRIVATE_NOTARIZE_LOGIN} -p ${X_PRIVATE_NOTARIZE_PWD} 78 | else 79 | xcrun notarytool submit $X_SOURCE_PATH/release/${X_BUILD_NAME}_portable_${X_RELEASE_VERSION}_${X_ARCHITECTURE}.zip --apple-id ${X_PRIVATE_NOTARIZE_LOGIN} --password ${X_PRIVATE_NOTARIZE_PWD} --team-id ${X_PRIVATE_NOTARIZE_TEAMID} --wait 80 | xcrun notarytool submit $X_SOURCE_PATH/release/${X_BUILD_NAME}_${X_RELEASE_VERSION}_${X_ARCHITECTURE}.pkg --apple-id ${X_PRIVATE_NOTARIZE_LOGIN} --password ${X_PRIVATE_NOTARIZE_PWD} --team-id ${X_PRIVATE_NOTARIZE_TEAMID} --wait 81 | fi 82 | fi 83 | 84 | cd $X_SOURCE_PATH 85 | } 86 | 87 | function make_clear 88 | { 89 | rm -rf $X_SOURCE_PATH/release/$X_BUILD_NAME 90 | } 91 | 92 | function fixlibrary 93 | { 94 | install_name_tool -change @rpath/$1.framework/Versions/5/$1 @executable_path/../Frameworks/$1.framework/Versions/5/$1 $2 95 | } 96 | 97 | function fiximport 98 | { 99 | fixlibrary QtWidgets $1 100 | fixlibrary QtGui $1 101 | fixlibrary QtCore $1 102 | fixlibrary QtDBus $1 103 | fixlibrary QtPrintSupport $1 104 | fixlibrary QtSvg $1 105 | fixlibrary QtOpenGL $1 106 | fixlibrary QtConcurrent $1 107 | fixlibrary QtScript $1 108 | fixlibrary QtScriptTools $1 109 | fixlibrary QtNetwork $1 110 | } 111 | 112 | function deploy_qt 113 | { 114 | "$X_QT_INSTALL_BINS/macdeployqt" $X_SOURCE_PATH/release/${X_BUILD_NAME}/$1.app 115 | } 116 | 117 | function deploy_qt_sign 118 | { 119 | "$X_QT_INSTALL_BINS/macdeployqt" $X_SOURCE_PATH/release/${X_BUILD_NAME}/$1.app 120 | codesign --deep -f -v -s "$X_PRIVATE_CERT_APP" -o runtime $X_SOURCE_PATH/release/${X_BUILD_NAME}/$1.app/Contents/MacOS/$1 121 | codesign -f -v -s "$X_PRIVATE_CERT_APP" -o runtime $X_SOURCE_PATH/release/${X_BUILD_NAME}/$1.app/Contents/MacOS/$1 122 | } 123 | 124 | function deploy_qt_sign_disable_protection 125 | { 126 | "$X_QT_INSTALL_BINS/macdeployqt" $X_SOURCE_PATH/release/${X_BUILD_NAME}/$1.app 127 | codesign --deep -f -v -s "$X_PRIVATE_CERT_APP" --entitlements $X_SOURCE_PATH/build_tools/disable_protection.plist -o runtime $X_SOURCE_PATH/release/${X_BUILD_NAME}/$1.app/Contents/MacOS/$1 128 | codesign -f -v -s "$X_PRIVATE_CERT_APP" --entitlements $X_SOURCE_PATH/build_tools/disable_protection.plist -o runtime $X_SOURCE_PATH/release/${X_BUILD_NAME}/$1.app/Contents/MacOS/$1 129 | } 130 | 131 | function deploy_qt_library 132 | { 133 | mkdir $X_SOURCE_PATH/release/$X_BUILD_NAME/$2.app/Contents/Frameworks 134 | mkdir $X_SOURCE_PATH/release/$X_BUILD_NAME/$2.app/Contents/Frameworks/$1.framework 135 | mkdir $X_SOURCE_PATH/release/$X_BUILD_NAME/$2.app/Contents/Frameworks/$1.framework/Versions 136 | mkdir $X_SOURCE_PATH/release/$X_BUILD_NAME/$2.app/Contents/Frameworks/$1.framework/Versions/5 137 | 138 | cp -R $X_QT_INSTALL_LIBS/$1.framework/Versions/5/$1 $X_SOURCE_PATH/release/$X_BUILD_NAME/$2.app/Contents/Frameworks/$1.framework/Versions/5 139 | 140 | install_name_tool -id @executable_path/../Frameworks/$1.framework/Versions/5/$1 $X_SOURCE_PATH/release/$X_BUILD_NAME/$2.app/Contents/Frameworks/$1.framework/Versions/5/$1 141 | fiximport $X_SOURCE_PATH/release/$X_BUILD_NAME/$2.app/Contents/Frameworks/$1.framework/Versions/5/$1 142 | } 143 | 144 | function deploy_qt_plugin 145 | { 146 | mkdir $X_SOURCE_PATH/release/$X_BUILD_NAME/$3.app/Contents/PlugIns/ 147 | mkdir $X_SOURCE_PATH/release/$X_BUILD_NAME/$3.app/Contents/PlugIns/$1/ 148 | cp -R $X_QT_INSTALL_PLUGINS/$1/$2.dylib $X_SOURCE_PATH/release/$X_BUILD_NAME/$3.app/Contents/PlugIns/$1/ 149 | 150 | install_name_tool -id @executable_path/../PlugIns/$1/$2.dylib $X_SOURCE_PATH/release/$X_BUILD_NAME/$3.app/Contents/PlugIns/$1/$2.dylib 151 | fiximport $X_SOURCE_PATH/release/$X_BUILD_NAME/$3.app/Contents/PlugIns/$1/$2.dylib 152 | } 153 | -------------------------------------------------------------------------------- /openssl/win_x64/libcrypto-1_1-x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/build_tools/bba0bd0ba87c455c4cf4b357dc7d95c3b466e13a/openssl/win_x64/libcrypto-1_1-x64.dll -------------------------------------------------------------------------------- /openssl/win_x64/libssl-1_1-x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/build_tools/bba0bd0ba87c455c4cf4b357dc7d95c3b466e13a/openssl/win_x64/libssl-1_1-x64.dll -------------------------------------------------------------------------------- /openssl/win_x86/libcrypto-1_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/build_tools/bba0bd0ba87c455c4cf4b357dc7d95c3b466e13a/openssl/win_x86/libcrypto-1_1.dll -------------------------------------------------------------------------------- /openssl/win_x86/libssl-1_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/build_tools/bba0bd0ba87c455c4cf4b357dc7d95c3b466e13a/openssl/win_x86/libssl-1_1.dll -------------------------------------------------------------------------------- /openssl/winxp_x86/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/build_tools/bba0bd0ba87c455c4cf4b357dc7d95c3b466e13a/openssl/winxp_x86/libeay32.dll -------------------------------------------------------------------------------- /openssl/winxp_x86/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/build_tools/bba0bd0ba87c455c4cf4b357dc7d95c3b466e13a/openssl/winxp_x86/ssleay32.dll -------------------------------------------------------------------------------- /qt_static_build.ps1: -------------------------------------------------------------------------------- 1 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 2 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 3 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 4 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 5 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 6 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 7 | # THE SOFTWARE. 8 | 9 | # Tested with QT 5.15.2 on Windows 10 10 | # https://mrfaptastic.github.io 11 | 12 | <# 13 | .SYNOPSIS 14 | 15 | Build a static version of Qt for Windows. 16 | 17 | .DESCRIPTION 18 | 19 | This scripts downloads Qt source code, compiles and installs a static version 20 | of Qt. It assumes that a prebuilt Qt / MinGW environment is already installed, 21 | typically in C:\Qt. This prebuilt environment uses shared libraries. It is 22 | supposed to remain the main development environment for Qt. This script adds 23 | a static version of the Qt libraries in order to allow the construction of 24 | standalone and self-sufficient executable. 25 | 26 | This script is typically run from the Windows Explorer. 27 | 28 | Requirements: 29 | - Windows PowerShell 3.0 or higher. 30 | - 7-zip. 31 | 32 | .PARAMETER QtSrcUrl 33 | 34 | URL of the Qt source file archive. 35 | By default, use the latest identified version. 36 | 37 | .PARAMETER QtStaticDir 38 | 39 | Root directory where the static versions of Qt are installed. 40 | By default, use C:\Qt\Static. 41 | 42 | .PARAMETER QtVersion 43 | 44 | The Qt version. By default, this script tries to extract the version number 45 | from the Qt source file name. 46 | 47 | .PARAMETER MingwDir 48 | 49 | Root directory of the MinGW prebuilt environment. By default, use the version 50 | which was installed by the prebuilt Qt environment. 51 | 52 | .PARAMETER NoPause 53 | 54 | Do not wait for the user to press at end of execution. By default, 55 | execute a "pause" instruction at the end of execution, which is useful 56 | when the script was run from Windows Explorer. 57 | #> 58 | 59 | [CmdletBinding()] 60 | param( 61 | $QtSrcUrl = "https://download.qt.io/official_releases/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.zip", 62 | $QtStaticDir = "C:\Qt\Static", # NO TRAILING SLASH 63 | $QtVersion = "5.15.2", #If you change this, you'll need to change the URL above to download as well... 64 | $MingwDir = "C:\Qt\Tools\mingw810_32", 65 | [switch]$NoPause = $false 66 | ) 67 | 68 | # PowerShell execution policy. 69 | Set-StrictMode -Version 3 70 | 71 | #----------------------------------------------------------------------------- 72 | # Main code 73 | #----------------------------------------------------------------------------- 74 | 75 | function Main 76 | { 77 | # Check that 7zip is installed. We use it to expand the downloaded archive. 78 | [void] (Get-7zip) 79 | 80 | # Get Qt source file name from URL. 81 | $QtSrcFileName = Split-Path -Leaf $QtSrcUrl 82 | 83 | # If Qt version is not specified on the command line, try to extract the value. 84 | if (-not $QtVersion) { 85 | $QtVersion = $QtSrcFileName -replace "`.[^`.]*$",'' 86 | $QtVersion = $QtVersion -replace 'qt-','' 87 | $QtVersion = $QtVersion -replace 'everywhere-','' 88 | $QtVersion = $QtVersion -replace 'opensource-','' 89 | $QtVersion = $QtVersion -replace 'src-','' 90 | $QtVersion = $QtVersion -replace '-src','' 91 | } 92 | Write-Output "Building static Qt version $QtVersion" 93 | 94 | # Qt installation directory. 95 | $QtDir = "$QtStaticDir\$QtVersion" 96 | 97 | # Get MinGW root directory, if not specified on the command line. 98 | if (-not $MingwDir) { 99 | # Search all instances of gcc.exe from C:\Qt prebuilt environment. 100 | $GccList = @(Get-ChildItem -Path C:\Qt\Tools\mingw*\bin\gcc.exe | ForEach-Object FullName | Sort-Object) 101 | if ($GccList.Length -eq 0) { 102 | Exit-Script "MinGW environment not found, no Qt prebuilt version?" 103 | } 104 | $MingwDir = (Split-Path -Parent (Split-Path -Parent $GccList[$GccList.Length - 1])) 105 | } 106 | Write-Output "Using MinGW from $MingwDir" 107 | 108 | # Build the directory tree where the static version of Qt will be installed. 109 | Create-Directory $QtStaticDir\src 110 | Create-Directory $QtDir 111 | 112 | # Download the Qt source package if not yet done. 113 | Download-File $QtSrcUrl $QtStaticDir\src\$QtSrcFileName 114 | 115 | # Directory of expanded packages. 116 | $QtSrcDir = "$QtStaticDir\src\$((Get-Item $QtStaticDir\src\$QtSrcFileName).BaseName)" 117 | 118 | # Expand archives if not yet done 119 | Expand-Archive $QtStaticDir\src\$QtSrcFileName $QtStaticDir\src $QtSrcDir 120 | 121 | # Patch Qt's mkspecs for static build. 122 | $File = "$QtSrcDir\qtbase\mkspecs\win32-g++\qmake.conf" 123 | if (-not (Select-String -Quiet -SimpleMatch -CaseSensitive "# [QT-STATIC-PATCH]" $File)) { 124 | Write-Output "Patching $File ..." 125 | Copy-Item $File "$File.orig" 126 | @" 127 | 128 | # [QT-STATIC-PATCH] 129 | QMAKE_LFLAGS += -static -static-libgcc 130 | QMAKE_CFLAGS_RELEASE -= -O2 131 | QMAKE_CFLAGS_RELEASE += -Os -momit-leaf-frame-pointer 132 | DEFINES += QT_STATIC_BUILD 133 | "@ | Out-File -Append $File -Encoding Ascii 134 | } 135 | 136 | # Set a clean path including MinGW. 137 | $env:Path += "$MingwDir\bin;$MingwDir\opt\bin;$env:SystemRoot\system32;$env:SystemRoot;$env:SystemRoot\system32\WindowsPowerShell\v1.0\;" 138 | 139 | 140 | # Check that the 'powershell' command is available 141 | # ... and ruby, python and perl - as per: qt-everywhere-src-X.XX.X\README 142 | # 143 | # https://forum.qt.io/topic/118511/static-qt-environment-error-using-qt5-15-0/7 144 | # 145 | [void] (Check-prequisites) 146 | 147 | 148 | # Force English locale to avoid weird effects of tools localization. 149 | $env:LANG = "en" 150 | 151 | # Set environment variable QT_INSTALL_PREFIX. Documentation says it should be 152 | # used by configure as prefix but this does not seem to work. So, we will 153 | # also specify -prefix option in configure. 154 | $env:QT_INSTALL_PREFIX = $QtDir 155 | 156 | # Configure, compile and install Qt. 157 | Push-Location $QtSrcDir 158 | cmd /c "configure.bat -static -release -platform win32-g++ -opensource -confirm-license -prefix $QtDir -qt-zlib -qt-libpng -qt-webp -qt-libjpeg -qt-freetype -no-opengl -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtlocation -skip qtlottie -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquick3d -skip qtquickcontrols -skip qtquickcontrols2 -skip qtquicktimeline -skip qtremoteobjects -skip qtsensors -skip qtspeech -skip qtsvg -skip qtwayland -skip qtwebglplugin -skip qtwebview -skip webengine -make libs -nomake tools -nomake examples -nomake tests" 159 | mingw32-make #-k -j4 160 | mingw32-make install #-k install 161 | Pop-Location 162 | 163 | # Patch Qt's installed mkspecs for static build of application. 164 | $File = "$QtDir\mkspecs\win32-g++\qmake.conf" 165 | @" 166 | CONFIG += static 167 | "@ | Out-File -Append $File -Encoding Ascii 168 | 169 | Exit-Script 170 | } 171 | 172 | #----------------------------------------------------------------------------- 173 | # A function to exit this script. The Message parameter is used on error. 174 | #----------------------------------------------------------------------------- 175 | 176 | function Exit-Script ([string]$Message = "") 177 | { 178 | $Code = 0 179 | if ($Message -ne "") { 180 | Write-Output "ERROR: $Message" 181 | $Code = 1 182 | } 183 | if (-not $NoPause) { 184 | pause 185 | } 186 | exit $Code 187 | } 188 | 189 | #----------------------------------------------------------------------------- 190 | # Silently create a directory. 191 | #----------------------------------------------------------------------------- 192 | 193 | function Create-Directory ([string]$Directory) 194 | { 195 | [void] (New-Item -Path $Directory -ItemType "directory" -Force) 196 | } 197 | 198 | #----------------------------------------------------------------------------- 199 | # Download a file if not yet present. 200 | # Warning: If file is present but incomplete, do not download it again. 201 | #----------------------------------------------------------------------------- 202 | 203 | function Download-File ([string]$Url, [string]$OutputFile) 204 | { 205 | $FileName = Split-Path $Url -Leaf 206 | if (-not (Test-Path $OutputFile)) { 207 | # Local file not present, start download. 208 | Write-Output "Downloading $Url ..." 209 | try { 210 | $webclient = New-Object System.Net.WebClient 211 | $webclient.DownloadFile($Url, $OutputFile) 212 | } 213 | catch { 214 | # Display exception. 215 | $_ 216 | # Delete partial file, if any. 217 | if (Test-Path $OutputFile) { 218 | Remove-Item -Force $OutputFile 219 | } 220 | # Abort 221 | Exit-Script "Error downloading $FileName" 222 | } 223 | # Check that the file is present. 224 | if (-not (Test-Path $OutputFile)) { 225 | Exit-Script "Error downloading $FileName" 226 | } 227 | } 228 | } 229 | 230 | #----------------------------------------------------------------------------- 231 | # Get path name of 7zip, abort if not found. 232 | #----------------------------------------------------------------------------- 233 | 234 | function Get-7zip 235 | { 236 | $Exe = "C:\Program Files\7-Zip\7z.exe" 237 | if (-not (Test-Path $Exe)) { 238 | $Exe = "C:\Program Files (x86)\7-Zip\7z.exe" 239 | } 240 | if (-not (Test-Path $Exe)) { 241 | Exit-Script "7-zip not found, install it first, see http://www.7-zip.org/" 242 | } 243 | $Exe 244 | } 245 | 246 | #----------------------------------------------------------------------------- 247 | # Check if PowerShell is available. 248 | #----------------------------------------------------------------------------- 249 | 250 | function Check-prequisites 251 | { 252 | if (Get-Command "powershell.exe" -ErrorAction SilentlyContinue) 253 | { 254 | echo "PowerShell is available.. This is good" 255 | } 256 | else 257 | { 258 | Exit-Script "'PowerShell' command is not available, check your windows path variable for this user account." 259 | } 260 | 261 | if (Get-Command "ruby" -ErrorAction SilentlyContinue) 262 | { 263 | echo "Ruby is available.. This is good" 264 | } 265 | else 266 | { 267 | Exit-Script "'ruby' is not available, check your windows path variable for this user account or install per the Qt everything instructions!" 268 | } 269 | 270 | 271 | if (Get-Command "python" -ErrorAction SilentlyContinue) 272 | { 273 | echo "Python is available.. This is good" 274 | } 275 | else 276 | { 277 | Exit-Script "'python' is not available, check your windows path variable for this user account or install ActivePython per the Qt everything instructions!" 278 | } 279 | 280 | if (Get-Command "perl" -ErrorAction SilentlyContinue) 281 | { 282 | echo "perl is available.. This is good" 283 | } 284 | else 285 | { 286 | Exit-Script "'perl' is not available, check your windows path variable for this user account or install ActivePerl per the Qt everything instructions!" 287 | } 288 | 289 | 290 | } 291 | 292 | 293 | #----------------------------------------------------------------------------- 294 | # Expand an archive file if not yet done. 295 | #----------------------------------------------------------------------------- 296 | 297 | function Expand-Archive ([string]$ZipFile, [string]$OutDir, [string]$CheckFile) 298 | { 299 | # Check presence of expected expanded file or directory. 300 | if (-not (Test-Path $CheckFile)) { 301 | Write-Output "Expanding $ZipFile ..." 302 | & (Get-7zip) x $ZipFile "-o$OutDir" | Select-String -Pattern "^Extracting " -CaseSensitive -NotMatch 303 | if (-not (Test-Path $CheckFile)) { 304 | Exit-Script "Error expanding $ZipFile, $OutDir\$CheckFile not found" 305 | } 306 | } 307 | } 308 | 309 | #----------------------------------------------------------------------------- 310 | # Execute main code. 311 | #----------------------------------------------------------------------------- 312 | 313 | . Main 314 | -------------------------------------------------------------------------------- /res/Info.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | @X_PROJECTNAME@ 9 | CFBundleIconFile 10 | main.icns 11 | CFBundleIdentifier 12 | @MACOSX_BUNDLE_GUI_IDENTIFIER@ 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleLongVersionString 16 | @X_PROJECT_VERSION@ 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@. 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@ 25 | CSResourcesFileMapped 26 | 27 | NSHumanReadableCopyright 28 | @X_COMPANYNAME@ 29 | 30 | 31 | -------------------------------------------------------------------------------- /res/resource.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "windows.manifest.xml" 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 6 | PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 7 | FILEFLAGSMASK 0x3fL 8 | #ifdef _DEBUG 9 | FILEFLAGS VS_FF_DEBUG 10 | #else 11 | FILEFLAGS 0x0L 12 | #endif 13 | FILEOS VOS__WINDOWS32 14 | FILETYPE VFT_DLL 15 | FILESUBTYPE 0x0L 16 | BEGIN 17 | BLOCK "StringFileInfo" 18 | BEGIN 19 | BLOCK "040904b0" 20 | BEGIN 21 | VALUE "CompanyName", "@X_COMPANYNAME@\0" 22 | VALUE "FileDescription", "@X_DESCRIPTION@\0" 23 | VALUE "FileVersion", "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.0\0" 24 | VALUE "LegalCopyright", "@X_MAINTAINER@\0" 25 | VALUE "OriginalFilename", "@X_ORIGINAL_FILENAME@.exe\0" 26 | VALUE "ProductName", "@X_PROJECTNAME@\0" 27 | VALUE "ProductVersion", "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.0\0" 28 | END 29 | END 30 | BLOCK "VarFileInfo" 31 | BEGIN 32 | VALUE "Translation", 0x0409, 1200 33 | END 34 | END 35 | /* End of Version info */ 36 | 37 | -------------------------------------------------------------------------------- /res/resource_icon.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | IDI_ICON1 ICON DISCARDABLE "main.ico" 4 | 5 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "windows.manifest.xml" 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 8 | PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 9 | FILEFLAGSMASK 0x3fL 10 | #ifdef _DEBUG 11 | FILEFLAGS VS_FF_DEBUG 12 | #else 13 | FILEFLAGS 0x0L 14 | #endif 15 | FILEOS VOS__WINDOWS32 16 | FILETYPE VFT_DLL 17 | FILESUBTYPE 0x0L 18 | BEGIN 19 | BLOCK "StringFileInfo" 20 | BEGIN 21 | BLOCK "040904b0" 22 | BEGIN 23 | VALUE "CompanyName", "@X_COMPANYNAME@\0" 24 | VALUE "FileDescription", "@X_DESCRIPTION@\0" 25 | VALUE "FileVersion", "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.0\0" 26 | VALUE "LegalCopyright", "@X_MAINTAINER@\0" 27 | VALUE "OriginalFilename", "@X_ORIGINAL_FILENAME@.exe\0" 28 | VALUE "ProductName", "@X_PROJECTNAME@\0" 29 | VALUE "ProductVersion", "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.0\0" 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x0409, 1200 35 | END 36 | END 37 | /* End of Version info */ 38 | 39 | -------------------------------------------------------------------------------- /res/windows.manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | true 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /windows.cmd: -------------------------------------------------------------------------------- 1 | call:%~1 %~2 %~3 2 | goto exit 3 | 4 | :check_file 5 | echo "Check file" 6 | echo %~1 7 | IF EXIST %~1 ( 8 | echo "Check file: %~1: TRUE" 9 | ) ELSE ( 10 | set X_ERROR="TRUE" 11 | echo "Cannot find file: %~1" 12 | ) 13 | goto:eof 14 | 15 | :make_init 16 | echo "init" 17 | set X_ARCHITECTURE=x86 18 | :msvc_env 19 | IF [%VSVARS_PATH%] == [] goto mingw_env 20 | call %VSVARS_PATH% 21 | set X_MAKE=nmake 22 | IF [%Platform%] == [] goto qmake_env 23 | set X_ARCHITECTURE=%Platform% 24 | goto qmake_env 25 | :mingw_env 26 | rem TODO platform 27 | IF [%MINGW_PATH%] == [] goto qmake_env 28 | set PATH=%MINGW_PATH% 29 | set X_MAKE=mingw32-make 30 | goto qmake_env 31 | set X_ERROR="TRUE" 32 | echo "Please set MSVC or MinGW" 33 | :qmake_env 34 | %QMAKE_PATH% -query QT_VERSION > qt_tmp.txt 35 | set /p X_QT_VERSION= qt_tmp.txt 37 | set /p X_QT_INSTALL_BINS= qt_tmp.txt 39 | set /p X_QT_INSTALL_PLUGINS= qt_tmp.txt 41 | set /p X_QMAKE_SPEC= 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | true 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | --------------------------------------------------------------------------------