Doesn't build on a (my) mac
In CMakeLists.txt
${SDL2_INCLUDE_DIR} => /usr/local/include/SDL2/
(SDL2 installed via homebrew)
#include <SDL2/SDL.h> fails as the directory "SDL2" is not in any of the include directories.
changing
- include_directories(${SDL2_INCLUDE_DIR})
+ include_directories(${SDL2_INCLUDE_DIR}/..)
Temporarily fixes it, we need a long term fix.
You can overwrite the directory CMake looks in when initially building makefiles with CMake. That way you can fix it on your computer without having to change the build files.
mkdir build && cd build
cmake -DSDL2_INCLUDE_DIR=/usr/local/include ..
make
CMake provides this functionality since it can't possibly know where to look on every type of setup.
Alternatively, we could have added something like include_directories("/usr/local/include") in the CMakeLists.txt file? Adding include's that are redundant on some systems shouldn't break the build.
@TheKnarf iirc you also have mac. Do you have the same problem when you try to build the project on your side?
@rexim I do have the same problem building on my Mac, and I solved it by adding the -DSDL2_INCLUDE_DIR=/usr/local/include paramater when running cmake (Overwriting where CMake finds SDL2).
@voldyman we can try to incorporate your workaround into CMakeLists.txt like that: 611fda140bd4817d473a76918b933cb07fc73bb7
Please pull the latest changes when you get a chance and let me know if it works for you.
@rexim, I forked the repo, and followed the Mac and Quickstart instructions as they are, had no issues building and running the build on a Mac, at least from current commit I'm in: https://github.com/tsoding/nothing/commit/3986d17dc7eb9959d8ccd59f1e28cf87583cdaf1
/cc @voldyman @TheKnarf