Skip to content
Permalink
Browse files

Fixed bug 5044 - CMake messes up hidapi path when project directory c…

…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 f7c9502dfbcf6eef85b246780f9a0ef426ed81b2
Showing with 1 addition and 1 deletion.
  1. +1 −1 cmake/sdlchecks.cmake
@@ -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)

0 comments on commit f7c9502

Please sign in to comment.