From a677f5a01ac428d16e0e83b021dd0e8cb1ee9f53 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Thu, 6 Apr 2023 11:41:12 +0200 Subject: [PATCH] Only try to link libraries when relevant feature is enabled fixes #182 --- source/Irrlicht/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/Irrlicht/CMakeLists.txt b/source/Irrlicht/CMakeLists.txt index 4d7141e..f2a3b5f 100644 --- a/source/Irrlicht/CMakeLists.txt +++ b/source/Irrlicht/CMakeLists.txt @@ -277,7 +277,7 @@ elseif(APPLE) find_library(IOKIT_LIB IOKit REQUIRED) add_definitions(-DGL_SILENCE_DEPRECATION) -else() +elseif(NOT USE_SDL2) # Unix probably find_package(X11 REQUIRED) if(USE_XINPUT2 AND NOT X11_Xi_FOUND) @@ -292,21 +292,21 @@ set(link_includes "${ZLIB_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${PNG_INCLUDE_DIR}" - "${SDL2_INCLUDE_DIRS}" + "$<$:${SDL2_INCLUDE_DIRS}>" ${OPENGL_INCLUDE_DIR} ${OPENGLES2_INCLUDE_DIR} ${EGL_INCLUDE_DIR} "$<$:${ANDROID_NDK}/sources/android/native_app_glue>" - ${X11_INCLUDE_DIR} + "$<$:${X11_INCLUDE_DIR}>" ) set(link_libs "${ZLIB_LIBRARY}" "${JPEG_LIBRARY}" "${PNG_LIBRARY}" - "${SDL2_LIBRARIES}" + "$<$:${SDL2_LIBRARIES}>" ${OPENGL_LIBRARIES} ${OPENGLES_LIBRARY} @@ -318,8 +318,8 @@ set(link_libs ${IOKIT_LIB} "$<$:gdi32>" "$<$:winmm>" - ${X11_X11_LIB} - ${X11_Xi_LIB} + "$<$:${X11_X11_LIB}>" + "$<$:${X11_Xi_LIB}>" ) # Source files