diff options
author | Steven Koo <steven.koo@ni.com> | 2021-03-10 12:21:33 -0600 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-03-19 15:40:09 -0500 |
commit | 9aafc0ace2272746d708dcac6e5daaa50b7da4c7 (patch) | |
tree | e26c85e334ca523312719bdae382dda8c18a90c7 /host/cmake/vcpkg/uhd-x64-windows-static-md.cmake | |
parent | ada6a4e46770d22d528b2b6fbc2bdd71e5e3064d (diff) | |
download | uhd-9aafc0ace2272746d708dcac6e5daaa50b7da4c7.tar.gz uhd-9aafc0ace2272746d708dcac6e5daaa50b7da4c7.tar.bz2 uhd-9aafc0ace2272746d708dcac6e5daaa50b7da4c7.zip |
uhd: enable vcpkg support on windows
vcpkg can be used for the Windows C++ dependencies for uhd with this commit.
To use vcpkg on Windows:
1) Copy the custom triplets in host/cmake/vcpkg/ to the vcpkg/triplets/ folder.
2) Install boost and libusb for the custom triplet
"vcpkg install libusb:uhd-x64-windows-static-md boost:uhd-x64-windows-static-md"
3) Call CMake with vcpkg toolchain file flags:
-DVCPKG_TARGET_TRIPLET=uhd-x64-windows-static-md
-DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALL_DIR%/scripts/buildsystems/vcpkg.cmake
-G "Visual Studio 16 2019" -A x64
Replace the -G with the installed version of Visual Studio and matching
architecture. Then build normally by running vcvarsall.bat and msbuild.
Signed-off-by: Steven Koo <steven.koo@ni.com>
Diffstat (limited to 'host/cmake/vcpkg/uhd-x64-windows-static-md.cmake')
-rw-r--r-- | host/cmake/vcpkg/uhd-x64-windows-static-md.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/host/cmake/vcpkg/uhd-x64-windows-static-md.cmake b/host/cmake/vcpkg/uhd-x64-windows-static-md.cmake new file mode 100644 index 000000000..ef577045d --- /dev/null +++ b/host/cmake/vcpkg/uhd-x64-windows-static-md.cmake @@ -0,0 +1,14 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +# uhd dynamic links for boost-test and libusb. +# The other boost dependencies are static. +# This maintains historical compatibility +# with previous binaries. +if (PORT STREQUAL boost-test) + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() + +if (PORT STREQUAL libusb) + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() |