mosra / magnum-bootstrap

Bootstrap projects for the Magnum C++11 graphics engine

Home Page:https://magnum.graphics/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vcpkg doesn't play well with FindXYZ modules

galexite opened this issue · comments

vcpkg's modules are overridden by the CMake find modules in the modules directory, which causes a build to fail to find those packages.

Annoyingly, the workaround seems to be:

if(NOT VCPKG_TOOLCHAIN)
	set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/modules/")
endif()

Which isn't exactly great.

Hi, thanks for the report!

Can you paste the whole error message? As far as I know, the modules from Magnum itself are included verbatim in vcpkg, so there shouldn't be any problem. The rest (SDL2 find module etc.) could be patched here to play well with vcpkg, so the above "not exactly great" thing is not needed. Or I hope so, depending on what error you are getting :)

After deleting that if statement, CMake was still able to find both Corrade and Magnum again even after deleting the cache. I use Visual Studio, so maybe my change to CMakeSettings.json didn't take place until I changed the CMakeLists.txt. Anyway, it's not an issue any longer.

Sorry to bother you!

Great, I got scared for a while :)

Yeah. Sorry about that. I should've checked outside VS first (I've just never used VS and vcpkg properly before).