VC++ install, vcpkg

English installer
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" --locale=english

https://github.com/Microsoft/vcpkg

更新
vcpkg remove --outdated
vcpkg install <list of libraries you want available by default>
See .\vcpkg help triplet for all supported targets.

只build release,可在triplet內加入
set(VCPKG_BUILD_TYPE release)

加compiler flag
build lib時
VCPKG_C_FLAGS
VCPKG_CXX_FLAGS
https://github.com/Microsoft/vcpkg/issues/3106

安裝可加參數
cmake -E env CFLAGS="-MP -Oi -arch:AVX2"  CXXFLAGS="-MP -Oi -arch:AVX2" cmake


使用lib方法
https://github.com/Microsoft/vcpkg/blob/master/docs/users/integration.md
cmake .. -DCMAKE_TOOLCHAIN_FILE=.../vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x86-windows-static
https://github.com/kvirc/KVIrc/issues/2400#issuecomment-421496054 

https://blogs.msdn.microsoft.com/vcblog/2016/11/01/vcpkg-updates-static-linking-is-now-available/


triplet的customization
https://github.com/Microsoft/vcpkg/blob/master/docs/users/triplets.md
VCPKG_CMAKE_SYSTEM_VERSION


只做release build
set(VCPKG_BUILD_TYPE release) 加入triplet file
https://github.com/Microsoft/vcpkg/issues/143

只安裝package的部分feature
https://github.com/Microsoft/vcpkg/blob/master/docs/specifications/feature-packages.md

> vcpkg search opencv
opencv               3.2.0            computer vision library
opencv[cuda]                          support for NVidia CUDA
opencv[contrib]                       community supported extensions for OpenCV

最小安裝就用 vcpkg install opencv[core]
裝多個feature
vcpkg install opencv[core,cuda]:x86-windows

留言

這個網誌中的熱門文章

OBS 抓不到畫面, 視窗, 遊戲擷取, 黑或白畫面, 當掉 ,卡住, black/white screen, window game capture, crash, freeze

優化實況(一) OBS設定 streaming settings

OBS plugin obs-text 顯示播放中音樂, display playing music