From 636951d3040e24c05dfb869d2c7fbf815ce9816f Mon Sep 17 00:00:00 2001 From: JosiahWI Date: Mon, 15 May 2023 10:43:41 -0500 Subject: [PATCH] Work around cmake<3.12 object target rules CMake does not allow specifying usage requirements with target_link_libraries() until version 3.12. --- source/Irrlicht/CMakeLists.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source/Irrlicht/CMakeLists.txt b/source/Irrlicht/CMakeLists.txt index 2ece4a0c..333a240b 100644 --- a/source/Irrlicht/CMakeLists.txt +++ b/source/Irrlicht/CMakeLists.txt @@ -308,6 +308,7 @@ set(link_libs "${ZLIB_LIBRARY}" "${JPEG_LIBRARY}" "${PNG_LIBRARY}" + tinygltf::tinygltf "$<$:${SDL2_LIBRARIES}>" ${OPENGL_LIBRARIES} @@ -341,7 +342,18 @@ add_library(IRRMESHOBJ OBJECT ${IRRMESHLOADER} ) -target_link_libraries(IRRMESHOBJ PRIVATE tinygltf::tinygltf) +get_property(tinygltf_INCLUDE_DIRS + TARGET tinygltf::tinygltf + PROPERTY INTERFACE_INCLUDE_DIRECTORIES +) + +get_property(tinygltf_COMPILE_DEFS + TARGET tinygltf::tinygltf + PROPERTY INTERFACE_COMPILE_DEFINITIONS +) + +target_include_directories(IRRMESHOBJ PRIVATE ${tinygltf_INCLUDE_DIRS}) +target_compile_definitions(IRRMESHOBJ PUBLIC ${tinygltf_COMPILE_DEFS}) add_library(IRROBJ OBJECT CBillboardSceneNode.cpp