mosra / magnum-bootstrap

Bootstrap projects for the Magnum C++11 graphics engine
https://magnum.graphics/
The Unlicense
92 stars 37 forks source link

vcpkg doesn't play well with FindXYZ modules #14

Closed galexite closed 6 years ago

galexite commented 6 years ago

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.

mosra commented 6 years ago

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 :)

galexite commented 6 years ago

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!

mosra commented 6 years ago

Great, I got scared for a while :)

galexite commented 6 years ago

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