|
| 1 | +# Builddefs-qmake documentation |
| 2 | +TODO |
| 3 | + |
| 4 | +## Packaging structure |
| 5 | + |
| 6 | +### Default behavior |
| 7 | +TODO |
| 8 | + |
| 9 | +### Package tree |
| 10 | + package_name/package_version/ |
| 11 | + package_name-package_version_remakeninfo.txt (or libname ??) |
| 12 | + bcom-package_name.pc (should be renamed to remaken-*.pc ?) |
| 13 | + interfaces/ |
| 14 | + lib/[arch]/[mode]/[config]/ |
| 15 | + |
| 16 | + |
| 17 | +### Package metadata |
| 18 | +An information file is created in the target package. The file is named ```[TARGET]-[VERSION]_remakeninfo.txt``` |
| 19 | + |
| 20 | +It contains the following informations : |
| 21 | + |
| 22 | +- ```platform``` : the supported compiler/platform version |
| 23 | +- ```cppstd``` : the c++ standard used |
| 24 | +- ```runtime``` : the runtime used (windows flag indicating whether the target uses the static or the dynamic runtime) |
| 25 | + |
| 26 | +### Dependencies declaration file |
| 27 | +For each project, a ```packagedependencies.txt``` file can be created in the root project folder. |
| 28 | + |
| 29 | +Each line follows the pattern : |
| 30 | + |
| 31 | + framework#channel|version|library name [% condition1 [% condition2]]...|identifier@repository_type|repository_url|link_mode|options |
| 32 | + |
| 33 | +where ```repository_type``` is a value in: |
| 34 | + |
| 35 | +- b-com |
| 36 | +- github |
| 37 | +- vcpkg |
| 38 | +- conan |
| 39 | +- system |
| 40 | +- path : local or network filesystem root path hosting the dependencies |
| 41 | + |
| 42 | +Conditions separated with % are compilation defined flags (i.e. -DCOMPILFLAG) used to toggle the dependency. |
| 43 | +It allows to build the package with several features enabled or not, and uses the underlying dependencies only when the feature is set. |
| 44 | + |
| 45 | +Conditions are set in the "library name" section, after the library name |
| 46 | + |
| 47 | +```link_mode``` is an optional value in : |
| 48 | + |
| 49 | +- static |
| 50 | +- shared |
| 51 | +- default (inherits the project's link mode) |
| 52 | +- na (not applicable) |
| 53 | + |
| 54 | +When ```link_mode``` is not provided : |
| 55 | + |
| 56 | +- For remaken (b-com and github), system and vcpkg dependencies link_mode is set to "default" |
| 57 | +- For conan, link_mode is set to "na" |
| 58 | + |
| 59 | +**Conan note**: |
| 60 | +>```link_mode``` is mandatory if the targeted dependency needs the option. When ```link_mode``` is not provided or is set to ```na```, it is not forwarded to conan, has some packages (typically header only libraries) don't define this option and setting the option leads to an error. |
| 61 | +
|
| 62 | +When ```repository_type``` is not specified : |
| 63 | + |
| 64 | +- it defaults to b-com when identifier is either ```bcomBuild``` or ```thirdParties``` (and in this case, the identifier is also the destination subfolder where the dependencies are installed) |
| 65 | +- it defaults to system when identifier is one of yum, apt, pkgtool, pkgutil, brew, macports, pacman, choco, zypper |
| 66 | + |
| 67 | +For other repository types (github, vcpkg, conan, system) when the identifier matches the repository type, |
| 68 | +the repository type reflects the ```identifier``` value - i.e. ```identifier``` = conan means ```repository_type``` is set to conan. |
| 69 | + |
| 70 | +When ```identifier``` is not specified : |
| 71 | + |
| 72 | +- @repository_type is mandatory |
| 73 | + |
| 74 | +When ```channel``` is not specified, it defaults to stable for conan dependencies. |
| 75 | + |
| 76 | +For b-com and github repositories, ```channel``` can be a combination of values from the remaken packaging manifest. |
| 77 | +It is not used for other kind of repos. |
| 78 | + |
| 79 | +Options are directly forwarded to the underlying repository tool. |
| 80 | + |
| 81 | +**Note** : |
| 82 | + |
| 83 | +>To provide specific options to dedicated system packaging tools, use one line for each specific tool describing the dependency. |
| 84 | +
|
| 85 | +>(once installed, system dependencies should not need specific options declarations during dependencies' parsing at project build stage. Hence the need for the below sample should be close to 0, except for packaging tools that build package upon install such as brew and macports and where build options can be provided). |
| 86 | +
|
| 87 | +>For instance : |
| 88 | +
|
| 89 | + eigen|3.3.5|eigen|system|https://github.com/SolarFramework/binaries/releases/download |
| 90 | + eigen|3.3.5|eigen|brew@system|https://github.com/SolarFramework/binaries/releases/download|default|-y |
| 91 | + eigen|3.3.5|eigen|pkgtool@system|https://github.com/SolarFramework/binaries/releases/download|default|--S --noconfirm |
| 92 | + |
| 93 | + |
| 94 | +### Sample repositories declarations : |
| 95 | + |
| 96 | + opencv|3.4.3|opencv|thirdParties|https://github.com/SolarFramework/binaries/releases/download |
| 97 | + xpcf|2.1.0|xpcf|bcomBuild|https://github.com/SolarFramework/binaries/releases/download|static| |
| 98 | + spdlog|0.14.0|spdlog|thirdParties@b-com|https://github.com/SolarFramework/binaries/releases/download |
| 99 | + eigen|3.3.5|eigen|system|https://github.com/SolarFramework/binaries/releases/download |
| 100 | + fbow|0.0.1|fbow|vcpkg|https://github.com/SolarFramework/binaries/releases/download |
| 101 | + boost|1.68.0|boost|conan|https://github.com/SolarFramework/binaries/releases/download |
| 102 | + freeglut#testing|3.0.0|freeglut|user@conan|https://github.com/SolarFramework/binaries/releases/download |
| 103 | + |
| 104 | +- github, b-com and path dependencies are installed using remaken packaging format through an url or filesystem repository. |
| 105 | +- System dependencies are installed using operating system dependent package manager (apt for linux debian and derivatives, brew for Mac OS X, chocolatey for windows...) |
| 106 | +- Conan dependencies are installed using packaging format with conan package manager |
| 107 | +- Vcpkg dependencies are installed using vcpkg packaging format with vcpkg package manager |
| 108 | + |
| 109 | +**WARNING** : |
| 110 | +>using system without any OS option implies the current system the tool is run on. |
| 111 | +Moreover, some OSes don't have a package manager, hence don't rely on system for android cross-compilation for instance. |
| 112 | + |
| 113 | +## Qmake informations |
| 114 | + |
| 115 | +### Common project structure |
| 116 | +- ```TARGET``` : defines the project name, usually final binary name |
| 117 | +- ```FRAMEWORK``` : defines a common package name for several libraries |
| 118 | +- ```INSTALLSUBDIR``` : defines an install subdirectory for package home directory |
| 119 | +- ```VERSION``` : defines version of the project |
| 120 | + |
| 121 | +include ```template*.pri``` file (after ```TARGET```, ```FRAMEWORK```, ```INSTALLSUBDIR```, ```VERSION``` declarations) |
| 122 | + |
| 123 | +### Define configuration |
| 124 | + |
| 125 | +```CONFIG``` defines how to build the current target : |
| 126 | + |
| 127 | +- [```static``` | ```staticlib```] builds the target as a static library/application |
| 128 | +- [```shared``` | ```dll```] builds the target as a static library/application |
| 129 | + |
| 130 | +```DEPENDENCIESCONFIG``` defines how to search and which dependencies to use : |
| 131 | + |
| 132 | +- [```sharedlib``` | ```shared```] search and use dependencies as shared libraries |
| 133 | +- [```staticlib``` | ```static```] search and use dependencies as static libraries |
| 134 | +- [```recursive``` | ```recurse```] search dependencies recursively from other remaken packagedependencies information files |
| 135 | +- [```install```] install first level shared dependencies with the target |
| 136 | +- [```install_recurse```] search dependencies recursively (see [```recursive```]) and install all shared dependencies with the target |
| 137 | + |
| 138 | +### Ignore dependencies install |
| 139 | +To ignore some specific dependencies install, define a ```packageignoreinstall.txt``` file in the root project folder. |
| 140 | + |
| 141 | +Define each framework ignored (as defined in packagedependencies.txt) with the pattern : |
| 142 | + |
| 143 | + framework1 framework2 |
| 144 | + |
| 145 | +or |
| 146 | + |
| 147 | + framework1 |
| 148 | + framework2 |
| 149 | + |
| 150 | +### Use project with Qt Vs Tools |
| 151 | + |
| 152 | +```Qt Vs tools``` is a Visual Studio plugin for manage a qmake project in Visual Studio by generating a msvc project |
| 153 | + |
| 154 | +- [Information link](https://doc.qt.io/qtvstools/index.html) |
| 155 | +- [Download link](https://download.qt.io/development_releases/vsaddin/) |
| 156 | + |
| 157 | +Define project for use with Qt Vs Tools : |
| 158 | + |
| 159 | + PROJECTCONFIG = QTVS |
| 160 | +allows to enable debug and release configurations, install of the package, ```DEPENDENCIESCONFIG``` flags ```install``` or ```install_recurse``` in msvc project generated |
| 161 | + |
| 162 | +To manage ```install``` or ```install_recurse``` with QTVS, include ```remaken_install_target.pri``` at the end od the .pro file |
| 163 | + |
| 164 | +declare QTVS config before include ```template*.pri``` file |
| 165 | + |
| 166 | +### Product information |
| 167 | +Defined in _ProductConfig.pri local project file |
| 168 | + |
| 169 | + PRODUCT_NAME |
| 170 | + PRODUCT_DESCRIPTION |
| 171 | + PRODUCT_MANUFACTURER sample = b<>com |
| 172 | + PRODUCT_MANUFACTURERCODE bCom |
| 173 | + PRODUCT_GUID example = 5855BF98-D32C-414C-BCA3-860BB8B4576E |
| 174 | + |
| 175 | + PRODUCT_VERSIONCODE hexadecimal based versioning |
| 176 | + PRODUCT_VERSION derived from project $${VERSION} |
| 177 | + PRODUCT_VERSIONSTRING derived from project "$${VERSION}" |
| 178 | + |
| 179 | +### Library Target |
| 180 | +TODO |
| 181 | + |
| 182 | +### Application Target |
| 183 | +TODO |
| 184 | + |
| 185 | +### Bundle/plugin Target |
| 186 | +TODO |
| 187 | + |
| 188 | +# Audio plugins specific files/variables |
| 189 | +TODO |
| 190 | +## _JuceConfig.pri local project file |
| 191 | +Starts with ```_ProductConfig.pri``` inclusion |
| 192 | +## Declare which plugin format(s) to build |
| 193 | + |
| 194 | +```QMAKE_JUCEAUDIOCONFIG``` defines the audio plugin formats to be built (sample : juceAU juceVST juceAAX juceVST3) |
| 195 | +Supported values: |
| 196 | + |
| 197 | +For each format declared in QMAKE_JUCEAUDIOCONFIG, the plugin category must be defined, for instance : |
| 198 | + |
| 199 | + JUCEPLUGIN_CATEGORY.juceAU = kAudioUnitType_Effect |
| 200 | + JUCEPLUGIN_CATEGORY.juceAUv3 = kAudioUnitType_Effect |
| 201 | + JUCEPLUGIN_CATEGORY.juceVST = kPlugCategSpacializer |
| 202 | + JUCEPLUGIN_CATEGORY.juceVST3 = kPlugCategSpacializer |
| 203 | + JUCEPLUGIN_CATEGORY.juceAAX = AAX_ePlugInCategory_SoundField |
| 204 | + JUCEPLUGIN_AUV3TAGS = Effects |
| 205 | + |
| 206 | +The plugin code is a 4 digit code and must be defined |
| 207 | + |
| 208 | + JUCEPLUGIN_PLUGINCODE#"H2Sk" |
| 209 | + |
| 210 | + JUCEPLUGIN ... |
| 211 | + PRODUCTNAME, PRODUCTNAME_SHORT vs TARGET |
0 commit comments