| Summary: | CMake messes up hidapi path when project directory contains spaces | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Eric Jing <rune.dart4> |
| Component: | build | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | trivial | ||
| Priority: | P2 | ||
| Version: | HG 2.1 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 10 | ||
Fixed, thanks! https://hg.libsdl.org/SDL/rev/1631ba283bc4 |
When the project directory path contains spaces, CMake butchers the include path for the hidapi files. I traced the problem to the cmake/sdlchecks.cmake file at line 1091, which sets flags for the build process. I surrounded the problem flag with double quotes, shown below, and CMake works with spaces in the project directory path. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS} \"-I${SDL2_SOURCE_DIR}/src/hidapi/hidapi\"")