pavelliavonau/cmakeconverter

Support vcpkg dependencies

BullyWiiPlaza opened this issue · 0 comments

I'm working on a Windows C++ solution for Visual Studio and I'm also using Microsoft's package manager vcpkg for installing dependencies. This works brilliantly. Now I also want to compile and debug my code for Linux using e.g. CLion IDE since CLion supports debugging using WSL, so I need to convert the Visual Studio solution to a CMake project. Overall the conversion seems fine besides the fact that CMake requires that I manually specify all dependent libraries from vcpkg unlike in a Visual Studio solution, for example:

find_package(nlohmann_json CONFIG REQUIRED)
# ...
target_link_libraries(Hello-World PRIVATE nlohmann_json nlohmann_json::nlohmann_json)

Visual Studio solutions provide automatic header resolution and linking of vcpkg packages without explicitly specifying where to look.

Unfortunately, the converter is not able to pick this up automatically to configure CMake with vcpkg dependencies. In order to successfully compile, I probably need to add all dependencies manually to the CMakeLists.txt. Is there any way I can automate this process better and if not, how would be a good way to support it?