From 5ba348662826e61d582a2f4cf98ceda2e89fca9d Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 29 Oct 2020 16:30:56 +0000 Subject: [PATCH] t/[gui|oxr]: Directly reference SDL2 in CMake This fixes the build when building with clang and CMake. --- src/xrt/targets/gui/CMakeLists.txt | 6 +++++- src/xrt/targets/openxr/CMakeLists.txt | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/xrt/targets/gui/CMakeLists.txt b/src/xrt/targets/gui/CMakeLists.txt index fe2483a7e..2cc5c774c 100644 --- a/src/xrt/targets/gui/CMakeLists.txt +++ b/src/xrt/targets/gui/CMakeLists.txt @@ -27,8 +27,12 @@ target_link_libraries(gui PRIVATE st_gui target_instance_no_comp imgui_impl_sdl + ${SDL2_LIBRARIES} + ) +target_include_directories(gui PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${SDL2_INCLUDE_DIRS} ) -target_include_directories(gui PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..) install(TARGETS gui RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} diff --git a/src/xrt/targets/openxr/CMakeLists.txt b/src/xrt/targets/openxr/CMakeLists.txt index 37b7f440a..a2a950228 100644 --- a/src/xrt/targets/openxr/CMakeLists.txt +++ b/src/xrt/targets/openxr/CMakeLists.txt @@ -35,8 +35,16 @@ target_link_libraries(${RUNTIME_TARGET} PUBLIC if(XRT_HAVE_OPENGL) target_link_libraries(${RUNTIME_TARGET} PUBLIC aux_ogl) endif() + if(XRT_HAVE_SDL2) - target_link_libraries(${RUNTIME_TARGET} PUBLIC st_gui imgui_impl_sdl) + target_link_libraries(${RUNTIME_TARGET} PRIVATE + st_gui + imgui_impl_sdl + ${SDL2_LIBRARIES} + ) + target_include_directories(${RUNTIME_TARGET} PRIVATE + ${SDL2_INCLUDE_DIRS} + ) endif() if(XRT_FEATURE_SERVICE) -- 2.51.2