I am using VS2022 with vcpkg integration in manifest mode for a CMake project. I already have defined a version in the CMakeLists.txt
that gets configured into a header and resource file:
cmake_minimum_required(VERSION 3.23)
project(clcto-lib VERSION 1.2.0.0)
# ...
To use vcpkg in manifest mode, I also include a vcpkg.json
:
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"name": "clcto-lib",
"version": "1.2.0.0",
"dependencies": [
"log4cxx"
]
}
Now, I have to specify the version in 2 places that should be kept in sync. I would like to avoid this so that the version is only specified once.
When in manifest mode, why do I have to specify the version? How is it used? How would I consume this in the CMakeLists.txt
file or when configuring? Since the vcpkg manifest is a good start for the port manifest, I would like to have this be the single-source of truth for the version if possible.
Upon further investigation it looks like the manifest file works with just "dependencies"
(and no "name"
and "version"
attributes). Is there a reason to include them in the project manifest as opposed to just the port?