We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5044

Summary: CMake messes up hidapi path when project directory contains spaces
Product: SDL Reporter: Eric Jing <rune.dart4>
Component: buildAssignee: 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   

Description Eric Jing 2020-03-20 00:51:29 UTC
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\"")
Comment 1 Sam Lantinga 2020-03-20 19:15:41 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/1631ba283bc4