I'm trying to build only the release version of packages because creating debug versions takes too long / too much space. Vcpkg docs state that:
Adding set(VCPKG_BUILD_TYPE release) in a triplet: will cause most ports to only build release
In terminal when I run set(VCPKG_BUILD_TYPE release)
I get
syntax error near unexpected token 'VCPKG_BUILD_TYPE'
How do I fix this?
builtin-baseline This field declares the versioning baseline for all ports. Setting a baseline is required to enable versioning, otherwise you will get the current versions on the ports directory. You can run 'git rev-parse HEAD' to get the current commit of vcpkg and set it as the builtin-baseline.
The best way to use installed libraries with cmake is via the toolchain file scripts\buildsystems\vcpkg. cmake . To use this file, you simply need to add it onto your CMake command line as: -DCMAKE_TOOLCHAIN_FILE=D:\src\vcpkg\scripts\buildsystems\vcpkg.
You probably need to set it in your triplet file. Make a copy and rename one of those default triplet files, say "x64-windows.cmake" to "x64-windows-rel.cmake". Then add a line so that:
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_BUILD_TYPE release)
I think this will work on some libraries but not all, as it requires the libraries' own build files (CMakeLists.txt) to deal with it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With