Skip to content

Commit

Permalink
Fixed bug 5044 - CMake messes up hidapi path when project directory c…
Browse files Browse the repository at this point in the history
…ontains spaces

Eric Jing

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.
  • Loading branch information
slouken committed Mar 20, 2020
1 parent 5b3b55a commit f7c9502
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/sdlchecks.cmake
Expand Up @@ -1088,7 +1088,7 @@ macro(CheckHIDAPI)
set(HAVE_SDL_JOYSTICK TRUE)
file(GLOB HIDAPI_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/hidapi/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${HIDAPI_SOURCES})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS} -I${SDL2_SOURCE_DIR}/src/hidapi/hidapi")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS} \"-I${SDL2_SOURCE_DIR}/src/hidapi/hidapi\"")
if(NOT HIDAPI_SKIP_LIBUSB)
if(HIDAPI_ONLY_LIBUSB)
set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/libusb/hid.c)
Expand Down

0 comments on commit f7c9502

Please sign in to comment.