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 - CMake messes up hidapi path when project directory contains spaces
Summary: CMake messes up hidapi path when project directory contains spaces
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 2.1
Hardware: x86_64 Windows 10
: P2 trivial
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-20 00:51 UTC by Eric Jing
Modified: 2020-03-20 19:15 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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