... | ... | @@ -20,7 +20,7 @@ |
|
|
|
|
|
**A set of minimal KMyMoney dependencies was upstreamed to vcpkg. Some of the ports required for optional functionality are still [pending approval](https://github.com/pulls?q=is%3Apr+is%3Aopen+author%3Awrobelda+repo%3Amicrosoft%2Fvcpkg+). You can use [this](https://github.com/wrobelda/vcpkg/tree/kmm_test) branch in the meanwhile, which has all of these PRs pulled-in.**
|
|
|
|
|
|
vcpkg is a command-line package manager for C++, supported on macOS, Linux and Windows platforms. It is a preferred way of obtaining the dependencies due to its ability to deploy them according to a declarative `vcpkg.json` manifesto provided with the source code. This allows us to maintain a set of dependencies [and their corresponding versions](https://devblogs.microsoft.com/cppblog/take-control-of-your-vcpkg-dependencies-with-versioning-support/) independently for each branch and automatically switching between them as needed. It also guarantees reproducibility of the dev environment and substantially reduces the effort required to set up a working environment.
|
|
|
vcpkg is a command-line package manager for C++, supported on macOS, Linux and Windows platforms. It is a preferred way of obtaining the dependencies due to its ability to deploy them according to a declarative [`vcpkg.json`](https://invent.kde.org/office/kmymoney/-/blob/master/vcpkg.json) manifesto provided with the source code. This allows us to maintain a set of dependencies [and their corresponding versions](https://devblogs.microsoft.com/cppblog/take-control-of-your-vcpkg-dependencies-with-versioning-support/) independently for each branch and automatically switching between them as needed. It also guarantees reproducibility of the dev environment and substantially reduces the effort required to set up a working environment.
|
|
|
|
|
|
## Installing vcpkg
|
|
|
|
... | ... | @@ -51,24 +51,30 @@ This all means that, depending on the platform you will be working on, a triplet |
|
|
|
|
|
## Setting-up your dev environment
|
|
|
|
|
|
Simply enable an additional switch in your CMake command:\
|
|
|
Simply enabling an additional switch in your CMake command should be enough:\
|
|
|
`-DCMAKE_TOOLCHAIN_FILE=[vcpkg root]/scripts/buildsystems/vcpkg.cmake`
|
|
|
|
|
|
Refer to [Using vcpkg with CMake](https://github.com/microsoft/vcpkg#using-vcpkg-with-cmake) guide on project's website for more details, as well as [CMake integration](https://github.com/microsoft/vcpkg/blob/master/docs/users/integration.md#cmake-integration) section of the documentation. Additional vcpkg CMake switches are documented [here](https://github.com/microsoft/vcpkg/blob/master/docs/users/manifests.md#cmake-integration).
|
|
|
|
|
|
Additionally, depending on the triplet chosen, you also have to have KMyMoney to link statically. Refer to the [CMake switches](Compilation#cmake-switches) section for details on that.
|
|
|
|
|
|
### Enabling additional features
|
|
|
|
|
|
The KMyMoney's [`vcpkg.json`](https://invent.kde.org/office/kmymoney/-/blob/master/vcpkg.json) manifest file defines some additional features, which instruct vcpkg to pull-in additional necessary dependencies.
|
|
|
|
|
|
Use `VCPKG_MANIFEST_FEATURES` switch to enable them, e.g. `-DVCPKG_MANIFEST_FEATURES="encryption;ical"`.
|
|
|
|
|
|
### Additional vcpkg documentation on env setup
|
|
|
|
|
|
Refer to [Using vcpkg with CMake](https://github.com/microsoft/vcpkg#using-vcpkg-with-cmake) guide on project's website if you need more help, as well as [CMake integration](https://github.com/microsoft/vcpkg/blob/master/docs/users/integration.md#cmake-integration) section of vcpkg's documentation. Additional vcpkg CMake switches are documented [here](https://github.com/microsoft/vcpkg/blob/master/docs/users/manifests.md#cmake-integration).
|
|
|
|
|
|
## Compiling the dependencies
|
|
|
|
|
|
After setting up your dev environment as instructed above, compiling the project with CMake will automatically trigger vcpkg to build the required packages, according to the `vcpkg.json` manifest file that is present in the root folder of the repository.
|
|
|
After setting up your dev environment as instructed above, compiling the project with CMake will automatically trigger vcpkg to build the required packages, according to the [`vcpkg.json`](https://invent.kde.org/office/kmymoney/-/blob/master/vcpkg.json) manifest file that is present in the root folder of the repository.
|
|
|
|
|
|
Note that this will initially compile the complete tree of the dependencies – i.e. those that are explicitly defined by the manifest file, as well as their own dependencies. This means that it may take several hours before your environment is ready.
|
|
|
|
|
|
Once built, the binaries built will be cached as zip files [on your filesystem](https://github.com/microsoft/vcpkg/blob/master/docs/users/binarycaching.md#configuration) and re-used on each consecutive installation attempt. That having said, they will be _ignored_ each time the build configuration or [any other factor changes](https://github.com/microsoft/vcpkg/blob/master/docs/users/binarycaching.md#implementation-notes-internal-details-subject-to-change-without-notice) and, as a result, will get rebuilt, so do not be surprised when that happens.
|
|
|
|
|
|
In the future, we may set up CI/CD infrastructure to allow downloading the required pre-built packages.
|
|
|
Once built, the binaries built will be cached as zip files [on your filesystem](https://github.com/microsoft/vcpkg/blob/master/docs/users/binarycaching.md#configuration) and re-used on each consecutive installation attempt. That having said, they will be _ignored_ each time the build configuration or [any other factor changes](https://github.com/microsoft/vcpkg/blob/master/docs/users/binarycaching.md#implementation-notes-internal-details-subject-to-change-without-notice) and, as a result, will get rebuilt, so do not be surprised when that happens.
|
|
|
|
|
|
You can also disable some optional components as needed – refer to the [switches](#cmake-switches) section and [VCPKG_MANIFEST_FEATURES](https://github.com/microsoft/vcpkg/blob/master/docs/users/manifests.md#vcpkg_manifest_features) CMake switch documentation for more information.
|
|
|
Additionally, some of the ports tend to be updated fairly frequently, such us Qt or fontconfig, which in turn will trigger an almost complete rebuild of the dependency tree. In order to reduce the annoyance of the costly recompilation, [`ccache` usage](Compilation#build-caching) is recommended.
|
|
|
|
|
|
## Troubleshooting
|
|
|
|
... | ... | |