Skip to content

Commit

Permalink
Fix server-only builds on older CMake versions (#11566)
Browse files Browse the repository at this point in the history
closes #11564
  • Loading branch information
sfan5 committed Aug 23, 2021
1 parent 0c1e960 commit fad835c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Expand Up @@ -71,8 +71,8 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/irrlichtmt")
endif()
else()
add_library(IrrlichtMt::IrrlichtMt INTERFACE IMPORTED)
target_include_directories(IrrlichtMt::IrrlichtMt INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/lib/irrlichtmt/include")
set_target_properties(IrrlichtMt::IrrlichtMt PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/irrlichtmt/include")
endif()
else()
find_package(IrrlichtMt QUIET)
Expand All @@ -90,7 +90,9 @@ else()
endif()
message(STATUS "Found Irrlicht headers: ${IRRLICHT_INCLUDE_DIR}")
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()
message(STATUS "Found IrrlichtMt ${IrrlichtMt_VERSION}")
endif()
Expand Down

0 comments on commit fad835c

Please sign in to comment.