← All tasks
cpprecastnavigation/recastnavigation #577Not a task: not reproduced

CMake SDL2 include paths missing on macOS

envgap__recastnavigation__recastnavigation-577

01 / FAILURE SIGNATURE

As reported upstream

/Library/Frameworks/SDL2.framework/Headers/SDL.h:32:10: fatal error: 'SDL2/SDL_main.h' file not found
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
3901c5854c958593443859fd1214162452ff2982
Manifest
CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

recastnavigation/recastnavigation #577 · read the original issue
## Setup:

m1 MacBook Pro

macOS 13.0

SDL2.framework installed to /Library/Frameworks



## Repro:

build with the following commands run from the root of a clean copy of the repo

```

cmake -B ./build -DCMAKE_BUILD_TYPE=Debug

cmake --build ./build --config Debug

```



results in:

```

...

[ 60%] Building CXX object RecastDemo/CMakeFiles/RecastDemo.dir/Source/ConvexVolumeTool.cpp.o

In file included from /Users/grahampentheny/workspace/recastnavigation/RecastDemo/Source/ConvexVolumeTool.cpp:24:

/Library/Frameworks/SDL2.framework/Headers/SDL.h:32:10: fatal error: 'SDL2/SDL_main.h' file not found

#include <SDL2/SDL_main.h>

         ^~~~~~~~~~~~~~~~~

1 error generated.

make[2]: *** [RecastDemo/CMakeFiles/RecastDemo.dir/Source/ConvexVolumeTool.cpp.o] Error 1

make[1]: *** [RecastDemo/CMakeFiles/RecastDemo.dir/all] Error 2

make: *** [all] Error 2

```



I suspect this line in `RecastDemo/CMakeLists.txt` is to blame, though I'm not sure how frameworks are handled by cmake.

```

include_directories(Contrib/SDL/include)

```



---



## Fix Requirements:

We ultimately need the cmake script to invoke clang with the `-framework SDL2` and `-I/Library/Frameworks/SDL2.framework/Headers` options.  



It would also be nice to be able to specify the SDL framework path (via `-F` clang flag) so it's not just hardcoded to `/Library/Frameworks`.  Specifying the framework path like this is useful for CI processes that might not want to or be able to muck about in `/Library`.
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]