CMake Error at CMakeLists.txt:47 (add_executable):
Target "magnum-primitives" links to target "SDL2::SDL2" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
brew info magnum
mosra/magnum/magnum: stable 2018.10, HEAD
C++11/C++14 graphics middleware for games and data visualization
https://magnum.graphics
/usr/local/Cellar/magnum/HEAD-11f6835 (358 files, 7.0MB) *
Built from source on 2019-02-03 at 22:33:38
From: https://github.com/mosra/homebrew-magnum/blob/master/Formula/magnum.rb
==> Dependencies
Required: cmake ✔, corrade ✔, sdl2 ✔, glfw ✔
==> Options
--HEAD
Install HEAD version
The text was updated successfully, but these errors were encountered:
How are you building the example? This error happens probably because the magnum's FindSDL2.cmake is not found and the builtin CMake SDL finding routine is not doing the right thing. If you follow the project structure in the Getting Started Guide, it should work, you can also clone the whole magnum-examples repository and build that.
I just realized the example documentation is quite lacking in this regard, I'm going to update it.
> Your avatar is _very_ hypnotic. :)
Yes, sometimes I am looking at it for a minutes. ;)
I made it work. Many thanks for your advices.
And... Just some feedback.
Looks like only FindSDL2 was missing. Its works without any other modules like i.e. FindCorrade, FindMagnumExtras. All examples are working (macOS) with such structure:
Yes, you're right. the FindCorrade and FindMagnum modules are installed so CMake is able to pick them up. The FindSDL2 module isn't because it's for a third-party library and if I would install it too, it might cause random conflicts with potentially different FindSDL2 modules of other projects. I'm still looking for a better solution for this, but the only other option I see right now is to travel back in time and add this module to upstream CMake for all versions back to 3.1. :)
Hello. I was trying to compile “Primitives example” on macOS. Magnum was installed from brew.
And I am getting this CMake error:
brew list:
The text was updated successfully, but these errors were encountered: