[CSM] Don't Load the package library (#6944)
[oweals/minetest.git] / src / CMakeLists.txt
index a7e26af7da77c4c91daef5aaf166919047b75ec5..c2b28832a19801093a06faf4483684d1a80ca9a6 100644 (file)
@@ -252,6 +252,12 @@ if(NOT MSVC)
        set(USE_GPROF FALSE CACHE BOOL "Use -pg flag for g++")
 endif()
 
+# Haiku endian support
+if(HAIKU)
+       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_BSD_SOURCE")
+       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_BSD_SOURCE")
+endif()
+
 # Use cmake_config.h
 add_definitions(-DUSE_CMAKE_CONFIG_H)
 
@@ -263,10 +269,12 @@ if(WIN32)
                add_definitions ( /D "_CRT_SECURE_NO_DEPRECATE" /W1 )
                # Get M_PI to work
                add_definitions(/D "_USE_MATH_DEFINES")
+               # Dont define min/max macros in minwindef.h
+               add_definitions(/D "NOMINMAX")
        else() # Probably MinGW = GCC
                set(PLATFORM_LIBS "")
        endif()
-       set(PLATFORM_LIBS ws2_32.lib shlwapi.lib ${PLATFORM_LIBS})
+       set(PLATFORM_LIBS ws2_32.lib version.lib shlwapi.lib ${PLATFORM_LIBS})
 
        # Zlib stuff
        set(ZLIB_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/../../zlib/zlib-1.2.5"
@@ -292,10 +300,15 @@ if(WIN32)
                set(VORBIS_DLL "" CACHE FILEPATH "Path to libvorbis.dll for installation (optional)")
                set(VORBISFILE_DLL "" CACHE FILEPATH "Path to libvorbisfile.dll for installation (optional)")
        endif()
+       if(USE_LUAJIT)
+               set(LUA_DLL "" CACHE FILEPATH "Path to lua51.dll for installation (optional)")
+       endif()
 else()
        # Unix probably
        if(BUILD_CLIENT)
-               find_package(X11 REQUIRED)
+               if(NOT HAIKU)
+                       find_package(X11 REQUIRED)
+               endif(NOT HAIKU)
                find_package(OpenGL REQUIRED)
                find_package(JPEG REQUIRED)
                find_package(BZip2 REQUIRED)
@@ -323,10 +336,12 @@ else()
                endif(HAVE_LIBRT)
        endif(APPLE)
 
+       if(NOT HAIKU)
        # 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})
+               find_library(XXF86VM_LIBRARY Xxf86vm)
+               mark_as_advanced(XXF86VM_LIBRARY)
+               set(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY})
+       endif(NOT HAIKU)
 
        # Prefer local iconv if installed
        find_library(ICONV_LIBRARY iconv)
@@ -356,6 +371,9 @@ add_custom_target(GenerateVersion
 
 
 add_subdirectory(threading)
+add_subdirectory(database)
+add_subdirectory(gui)
+add_subdirectory(mapgen)
 add_subdirectory(network)
 add_subdirectory(script)
 add_subdirectory(unittest)
@@ -363,8 +381,9 @@ add_subdirectory(util)
 add_subdirectory(irrlicht_changes)
 
 set(common_SRCS
+       ${database_SRCS}
+       ${mapgen_SRCS}
        ban.cpp
-       cavegen.cpp
        chat.cpp
        clientiface.cpp
        collision.cpp
@@ -373,16 +392,8 @@ set(common_SRCS
        content_sao.cpp
        convert_json.cpp
        craftdef.cpp
-       database-dummy.cpp
-       database-files.cpp
-       database-leveldb.cpp
-       database-postgresql.cpp
-       database-redis.cpp
-       database-sqlite3.cpp
-       database.cpp
        debug.cpp
        defaultsettings.cpp
-       dungeongen.cpp
        emerge.cpp
        environment.cpp
        face_position_cache.cpp
@@ -399,22 +410,10 @@ set(common_SRCS
        map.cpp
        map_settings_manager.cpp
        mapblock.cpp
-       mapgen.cpp
-       mapgen_carpathian.cpp
-       mapgen_flat.cpp
-       mapgen_fractal.cpp
-       mapgen_singlenode.cpp
-       mapgen_v5.cpp
-       mapgen_v6.cpp
-       mapgen_v7.cpp
-       mapgen_valleys.cpp
        mapnode.cpp
        mapsector.cpp
        metadata.cpp
-       mg_biome.cpp
-       mg_decoration.cpp
-       mg_ore.cpp
-       mg_schematic.cpp
+       modchannels.cpp
        mods.cpp
        nameidmapping.cpp
        nodedef.cpp
@@ -439,17 +438,17 @@ set(common_SRCS
        serverlist.cpp
        serverobject.cpp
        settings.cpp
-       socket.cpp
        sound.cpp
        staticobject.cpp
        subgame.cpp
        terminal_chat_console.cpp
        tileanimation.cpp
        tool.cpp
-       treegen.cpp
+       translation.cpp
        version.cpp
        voxel.cpp
        voxelalgorithms.cpp
+       hud.cpp
        ${common_network_SRCS}
        ${JTHREAD_SRCS}
        ${common_SCRIPT_SRCS}
@@ -487,6 +486,7 @@ endif(BUILD_CLIENT)
 set(client_SRCS
        ${client_SRCS}
        ${common_SRCS}
+       ${gui_SRCS}
        ${sound_SRCS}
        ${client_network_SRCS}
        ${client_irrlicht_changes_SRCS}
@@ -504,18 +504,9 @@ set(client_SRCS
        filecache.cpp
        fontengine.cpp
        game.cpp
-       guiChatConsole.cpp
-       guiEngine.cpp
-       guiPathSelectMenu.cpp
-       guiFormSpecMenu.cpp
-       guiKeyChangeMenu.cpp
-       guiPasswordChange.cpp
        guiscalingfilter.cpp
-       guiTable.cpp
-       guiVolumeChange.cpp
        hud.cpp
        imagefilters.cpp
-       intlGUIEditBox.cpp
        keycode.cpp
        localplayer.cpp
        main.cpp
@@ -809,6 +800,9 @@ if(WIN32)
        if(LEVELDB_DLL)
                install(FILES ${LEVELDB_DLL} DESTINATION ${BINDIR})
        endif()
+       if(LUA_DLL)
+               install(FILES ${LUA_DLL} DESTINATION ${BINDIR})
+       endif()
 endif()
 
 if(BUILD_CLIENT)