Skip to content
Permalink
Browse files
Allow lib/irrlichtmt to work for server builds (headers-only)
  • Loading branch information
sfan5 committed Aug 21, 2021
1 parent 6fd8aed commit a72d13064fcbddaf332c7d53e6f34b74d8781586
Showing with 13 additions and 7 deletions.
  1. +13 −7 CMakeLists.txt
@@ -60,13 +60,19 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# This is done here so that relative search paths are more reasonable
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/irrlichtmt")
message(STATUS "Using user-provided IrrlichtMt at subdirectory 'lib/irrlichtmt'")
# tell IrrlichtMt to create a static library
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared library" FORCE)
add_subdirectory(lib/irrlichtmt EXCLUDE_FROM_ALL)
unset(BUILD_SHARED_LIBS CACHE)

if(NOT TARGET IrrlichtMt)
message(FATAL_ERROR "IrrlichtMt project is missing a CMake target?!")
if(BUILD_CLIENT)
# tell IrrlichtMt to create a static library
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared library" FORCE)
add_subdirectory(lib/irrlichtmt EXCLUDE_FROM_ALL)
unset(BUILD_SHARED_LIBS CACHE)

if(NOT TARGET IrrlichtMt)
message(FATAL_ERROR "IrrlichtMt project is missing a CMake target?!")
endif()
else()
add_library(IrrlichtMt::IrrlichtMt INTERFACE IMPORTED)
target_include_directories(IrrlichtMt::IrrlichtMt INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/lib/irrlichtmt/include")
endif()
else()
find_package(IrrlichtMt QUIET)

0 comments on commit a72d130

Please sign in to comment.