VCPkg integration on Windows?



  • Is there any supported way to have QMake / Qt Creator pull in packages installed using vcpkg? Currently, I have been adding every single package to my .pro file by hand, which is a massive pain when you have a few dependencies. Using one Boost library means having to manually add the INCLUDEPATH for every followon dependency, which is a massive pain, and not easy to make portable if I wanted to build on another system that might have vcpkg installed in another location. And the user on the other machine would have to manually install every package.

    Surely, this can't be the right way to do it. Is there some Qmake function, or Qt Creator plugin that I am missing that would simplify this? Ideally I would just be able to say something like "win32:vcpkg-depends: boost-filesystem" and be able to build.

    CONFIG(debug) {
        win32:LIBS += -L"C:/Users/wrose/Documents/development/vcpkg/packages/boost-filesystem_x64-windows/debug/lib"
        win32:LIBS += -L"C:/Users/wrose/Documents/development/vcpkg/packages/boost-system_x64-windows/debug/lib"
        win32:LIBS += -lboost_filesystem-vc140-mt-gd-1_66 -lboost_system-vc140-mt-gd-1_66
        message("Merry Debug")
    } else {
        win32:LIBS += -L"C:/Users/wrose/Documents/development/vcpkg/packages/boost-filesystem_x64-windows/lib"
        win32:LIBS += -L"C:/Users/wrose/Documents/development/vcpkg/packages/boost-system_x64-windows/lib"
        win32:LIBS += -lboost_filesystem-vc140-mt-1_66 -lboost_system-vc140-mt-1_66
        message("Happy Release")
    }
    
    
    
    
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-filesystem_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-config_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-system_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-core_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-type-traits_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-predef_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-assert_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-iterator_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-mpl_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-preprocessor_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-static-assert_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-detail_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-smart-ptr_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-throw-exception_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-io_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-functional_x64-windows/include"
    win32:INCLUDEPATH += "C:/Users/wrose/Documents/development/vcpkg/packages/boost-range_x64-windows/include"
    
    

  • Lifetime Qt Champion

    Hi,

    From a quick look they provide integration for cmake. See here.

    That might be the quick and easy way to go.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.