I would like to use CMake to build my own libraries executables. I have installed both dynamic and static x64 versions of 3rd party libraries like boost. When I compile my own projects with cmake I can't get it to use the static versions. Here is my setup:
- cmake 3.18.1
- vcpkg pulled from master branch (Aug 11, 2020)
- Visual Studio 2019 16.6.1.0
- Running in a docker container with Windows Server Core 2019
When I just do cmake ..
and cmake --build .
it defaults to x64-windows as expected. I have one 3rd party library that only exist as a static library (x64-windows-static) so then I try this:
cmake .. "-DVCPKG_TARGET_TRIPLET=x64-windows-static" "-DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake"
according to other posts. I have done different experiments and versions of these commands and the result is either:
- vcpkg is not enabled
- using x64-windows
But never "using x64-windows-static" which is what I want. I just can't make this to work. I have tried to set environment variables or adding the commands to the cmake files as well. But the result is the same, it refuses to use the "x64-windows-static" triplet. All third party libraries that I have used, have been compiled and installed properly with both versions.
Any ideas what I do wrong?