aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt41
1 files changed, 7 insertions, 34 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ac460883a..7a5e48b49 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -293,33 +293,7 @@ else()
if(NOT HAIKU AND NOT APPLE)
find_package(X11 REQUIRED)
endif(NOT HAIKU AND NOT APPLE)
-
- ##
- # The following dependencies are transitive dependencies from Irrlicht.
- # Minetest itself does not use them, but we link them so that statically
- # linking Irrlicht works.
- if(NOT HAIKU AND NOT APPLE)
- # This way Xxf86vm is found on OpenBSD too
- find_library(XXF86VM_LIBRARY Xxf86vm)
- mark_as_advanced(XXF86VM_LIBRARY)
- set(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY})
- endif(NOT HAIKU AND NOT APPLE)
-
- find_package(JPEG REQUIRED)
- find_package(PNG REQUIRED)
- if(APPLE)
- find_library(CARBON_LIB Carbon REQUIRED)
- find_library(COCOA_LIB Cocoa REQUIRED)
- find_library(IOKIT_LIB IOKit REQUIRED)
- mark_as_advanced(
- CARBON_LIB
- COCOA_LIB
- IOKIT_LIB
- )
- SET(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${CARBON_LIB} ${COCOA_LIB} ${IOKIT_LIB})
- endif(APPLE)
- ##
- endif(BUILD_CLIENT)
+ endif()
find_package(ZLIB REQUIRED)
set(PLATFORM_LIBS -lpthread ${CMAKE_DL_LIBS})
@@ -511,9 +485,7 @@ endif()
include_directories(
${PROJECT_BINARY_DIR}
${PROJECT_SOURCE_DIR}
- ${IRRLICHT_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR}
- ${PNG_INCLUDE_DIR}
${SOUND_INCLUDE_DIRS}
${SQLITE3_INCLUDE_DIR}
${LUA_INCLUDE_DIR}
@@ -548,10 +520,7 @@ if(BUILD_CLIENT)
target_link_libraries(
${PROJECT_NAME}
${ZLIB_LIBRARIES}
- ${IRRLICHT_LIBRARY}
- ${JPEG_LIBRARIES}
- ${BZIP2_LIBRARIES}
- ${PNG_LIBRARIES}
+ IrrlichtMt::IrrlichtMt
${X11_LIBRARIES}
${SOUND_LIBRARIES}
${SQLITE3_LIBRARY}
@@ -559,7 +528,6 @@ if(BUILD_CLIENT)
${GMP_LIBRARY}
${JSON_LIBRARY}
${PLATFORM_LIBS}
- ${CLIENT_PLATFORM_LIBS}
)
if(NOT USE_LUAJIT)
set_target_properties(${PROJECT_NAME} PROPERTIES
@@ -629,6 +597,11 @@ endif(BUILD_CLIENT)
if(BUILD_SERVER)
add_executable(${PROJECT_NAME}server ${server_SRCS} ${extra_windows_SRCS})
add_dependencies(${PROJECT_NAME}server GenerateVersion)
+
+ get_target_property(
+ IRRLICHT_INCLUDES IrrlichtMt::IrrlichtMt INTERFACE_INCLUDE_DIRECTORIES)
+ # Doesn't work without PRIVATE/PUBLIC/INTERFACE mode specified.
+ target_include_directories(${PROJECT_NAME}server PRIVATE ${IRRLICHT_INCLUDES})
target_link_libraries(
${PROJECT_NAME}server
${ZLIB_LIBRARIES}