diff options
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 77 |
1 files changed, 72 insertions, 5 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8d0363548..d2f080c90 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,6 +5,7 @@ cmake_minimum_required( VERSION 2.6 ) mark_as_advanced(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH) mark_as_advanced(JTHREAD_INCLUDE_DIR JTHREAD_LIBRARY) mark_as_advanced(SQLITE3_INCLUDE_DIR SQLITE3_LIBRARY) +mark_as_advanced(JSON_INCLUDE_DIR JSON_LIBRARY) option(ENABLE_CURL "Enable cURL support for fetching media" 1) @@ -93,6 +94,12 @@ if(USE_SOUND) ) endif() +option(ENABLE_FREETYPE "Enable freetype2 (truetype fonts and basic unicode support)" OFF) +set(USE_FREETYPE 0) +if(ENABLE_FREETYPE) + set(USE_FREETYPE 1) +endif(ENABLE_FREETYPE) + if(NOT MSVC) set(USE_GPROF 0 CACHE BOOL "Use -pg flag for g++") endif() @@ -117,6 +124,14 @@ if(WIN32) CACHE FILEPATH "Path to zlibwapi.dll (for installation)") set(IRRLICHT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../irrlicht-1.7.2" CACHE PATH "irrlicht dir") + if(USE_FREETYPE) + set(FREETYPE_INCLUDE_DIR_ft2build "${PROJECT_SOURCE_DIR}/../../freetype2/include/" + CACHE PATH "freetype include dir") + set(FREETYPE_INCLUDE_DIR_freetype2 "${PROJECT_SOURCE_DIR}/../../freetype2/include/freetype" + CACHE PATH "freetype include dir") + set(FREETYPE_LIBRARY "${PROJECT_SOURCE_DIR}/../../freetype2/objs/win32/vc2005/freetype247.lib" + CACHE FILEPATH "Path to freetype247.lib") + endif(USE_FREETYPE) set(MINGWM10_DLL "" CACHE FILEPATH "Path to mingwm10.dll (for installation)") if(ENABLE_SOUND) @@ -156,6 +171,13 @@ endif() find_package(Jthread REQUIRED) find_package(Sqlite3 REQUIRED) +find_package(Json REQUIRED) + +if(USE_FREETYPE) + find_package(Freetype REQUIRED) + set(CGUITTFONT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cguittfont") + set(CGUITTFONT_LIBRARY cguittfont) +endif(USE_FREETYPE) # Do not use system-wide installation of Lua, because it'll likely be a # different version and/or has different build options. @@ -187,6 +209,7 @@ set(common_SRCS script.cpp log.cpp content_sao.cpp + emerge.cpp mapgen.cpp mapgen_v6.cpp treegen.cpp @@ -222,6 +245,7 @@ set(common_SRCS biome.cpp clientserver.cpp staticobject.cpp + serverlist.cpp util/serialize.cpp util/directiontables.cpp util/numeric.cpp @@ -274,6 +298,7 @@ set(minetest_SRCS guiFormSpecMenu.cpp guiPauseMenu.cpp guiPasswordChange.cpp + guiVolumeChange.cpp guiDeathScreen.cpp guiChatConsole.cpp guiCreateWorld.cpp @@ -283,11 +308,17 @@ set(minetest_SRCS filecache.cpp tile.cpp shader.cpp - serverlist.cpp game.cpp main.cpp ) +if(USE_FREETYPE) + set(minetest_SRCS + ${minetest_SRCS} + intlGUIEditBox.cpp + ) +endif(USE_FREETYPE) + # Server sources set(minetestserver_SRCS ${common_SRCS} @@ -305,8 +336,22 @@ include_directories( ${JTHREAD_INCLUDE_DIR} ${SQLITE3_INCLUDE_DIR} ${LUA_INCLUDE_DIR} + ${JSON_INCLUDE_DIR} ) +if(USE_FREETYPE) + include_directories( + ${FREETYPE_INCLUDE_DIRS} + ${CGUITTFONT_INCLUDE_DIR} + ) +endif(USE_FREETYPE) + +if(USE_CURL) + include_directories( + ${CURL_INCLUDE_DIR} + ) +endif(USE_CURL) + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin") if(BUILD_CLIENT) @@ -325,19 +370,23 @@ if(BUILD_CLIENT) ${JTHREAD_LIBRARY} ${SQLITE3_LIBRARY} ${LUA_LIBRARY} + ${JSON_LIBRARY} ${PLATFORM_LIBS} ${CLIENT_PLATFORM_LIBS} ) - if(USE_CURL) target_link_libraries( ${PROJECT_NAME} ${CURL_LIBRARY} ) - include_directories( - ${CURL_INCLUDE_DIR} - ) endif(USE_CURL) + if(USE_FREETYPE) + target_link_libraries( + ${PROJECT_NAME} + ${FREETYPE_LIBRARY} + ${CGUITTFONT_LIBRARY} + ) + endif(USE_FREETYPE) endif(BUILD_CLIENT) if(BUILD_SERVER) @@ -347,11 +396,20 @@ if(BUILD_SERVER) ${ZLIB_LIBRARIES} ${JTHREAD_LIBRARY} ${SQLITE3_LIBRARY} + ${JSON_LIBRARY} + ${GETTEXT_LIBRARY} ${LUA_LIBRARY} ${PLATFORM_LIBS} ) + if(USE_CURL) + target_link_libraries( + ${PROJECT_NAME}server + ${CURL_LIBRARY} + ) + endif(USE_CURL) endif(BUILD_SERVER) + # # Set some optimizations and tweaks # @@ -518,9 +576,18 @@ else (SQLITE3_FOUND) add_subdirectory(sqlite) endif (SQLITE3_FOUND) +if (BUILD_CLIENT AND USE_FREETYPE) + add_subdirectory(cguittfont) +endif (BUILD_CLIENT AND USE_FREETYPE) + if (LUA_FOUND) else (LUA_FOUND) add_subdirectory(lua) endif (LUA_FOUND) +if (JSON_FOUND) +else (JSON_FOUND) + add_subdirectory(json) +endif (JSON_FOUND) + #end |