Fix server-only builds on older CMake versions (#11566)

closes #11564
This commit is contained in:
sfan5 2021-08-23 13:33:25 +02:00 committed by GitHub
parent 0c1e9603db
commit fad835cf64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -71,8 +71,8 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/irrlichtmt")
endif() endif()
else() else()
add_library(IrrlichtMt::IrrlichtMt INTERFACE IMPORTED) add_library(IrrlichtMt::IrrlichtMt INTERFACE IMPORTED)
target_include_directories(IrrlichtMt::IrrlichtMt INTERFACE set_target_properties(IrrlichtMt::IrrlichtMt PROPERTIES
"${CMAKE_CURRENT_SOURCE_DIR}/lib/irrlichtmt/include") INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/irrlichtmt/include")
endif() endif()
else() else()
find_package(IrrlichtMt QUIET) find_package(IrrlichtMt QUIET)
@ -90,7 +90,9 @@ else()
endif() endif()
message(STATUS "Found Irrlicht headers: ${IRRLICHT_INCLUDE_DIR}") message(STATUS "Found Irrlicht headers: ${IRRLICHT_INCLUDE_DIR}")
add_library(IrrlichtMt::IrrlichtMt INTERFACE IMPORTED) add_library(IrrlichtMt::IrrlichtMt INTERFACE IMPORTED)
target_include_directories(IrrlichtMt::IrrlichtMt INTERFACE "${IRRLICHT_INCLUDE_DIR}") # Note that we can't use target_include_directories() since that doesn't work for IMPORTED targets before CMake 3.11
set_target_properties(IrrlichtMt::IrrlichtMt PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${IRRLICHT_INCLUDE_DIR}")
else() else()
message(STATUS "Found IrrlichtMt ${IrrlichtMt_VERSION}") message(STATUS "Found IrrlichtMt ${IrrlichtMt_VERSION}")
endif() endif()