From 25a06cae62d23e4df9d29da3c85b4212125db28c Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 21 Jan 2024 18:05:25 +0100 Subject: [PATCH] CMake: fix generator conditional expressions OPENGL_LIBRARIES may contain multiple paths, separated by semicolons. In CMake 3.22.1 this results in an improper list of libraries when passing through a separate variable. --- source/Irrlicht/CMakeLists.txt | 40 ++++++++++++++++------------------ 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/source/Irrlicht/CMakeLists.txt b/source/Irrlicht/CMakeLists.txt index f90728bc..01b6c9b8 100644 --- a/source/Irrlicht/CMakeLists.txt +++ b/source/Irrlicht/CMakeLists.txt @@ -314,26 +314,6 @@ set(link_includes "$<$:${X11_INCLUDE_DIR}>" ) -set(link_libs - "${ZLIB_LIBRARY}" - "${JPEG_LIBRARY}" - "${PNG_LIBRARY}" - "$<$:${SDL2_LIBRARIES}>" - - "$<$:${OPENGL_LIBRARIES}>" - "$<$:${OPENGLES_LIBRARY}>" - "$<$:${OPENGLES2_LIBRARIES}>" - ${EGL_LIBRARY} - - "$<$:-landroid -llog>" - ${COCOA_LIB} - ${IOKIT_LIB} - "$<$:gdi32>" - "$<$:winmm>" - "$<$:${X11_X11_LIB}>" - "$<$:${X11_Xi_LIB}>" -) - # Source files set(IRRMESHLOADER @@ -533,7 +513,25 @@ target_include_directories(IrrlichtMt ${link_includes} ) -target_link_libraries(IrrlichtMt PRIVATE ${link_libs}) +target_link_libraries(IrrlichtMt PRIVATE + "${ZLIB_LIBRARY}" + "${JPEG_LIBRARY}" + "${PNG_LIBRARY}" + "$<$:${SDL2_LIBRARIES}>" + + "$<$:${OPENGL_LIBRARIES}>" + "$<$:${OPENGLES_LIBRARY}>" + "$<$:${OPENGLES2_LIBRARIES}>" + ${EGL_LIBRARY} + + "$<$:-landroid -llog>" + ${COCOA_LIB} + ${IOKIT_LIB} + "$<$:gdi32>" + "$<$:winmm>" + "$<$:${X11_X11_LIB}>" + "$<$:${X11_Xi_LIB}>" +) if(WIN32) target_compile_definitions(IrrlichtMt INTERFACE _IRR_WINDOWS_API_) # used in _IRR_DEBUG_BREAK_IF definition in a public header