1 cmake_minimum_required(VERSION 2.6)
5 INCLUDE(CheckIncludeFiles)
6 INCLUDE(CheckLibraryExists)
8 # Add custom SemiDebug build mode
9 set(CMAKE_CXX_FLAGS_SEMIDEBUG "-O1 -g -Wall -Wabi" CACHE STRING
10 "Flags used by the C++ compiler during semidebug builds."
13 set(CMAKE_C_FLAGS_SEMIDEBUG "-O1 -g -Wall -pedantic" CACHE STRING
14 "Flags used by the C compiler during semidebug builds."
18 CMAKE_CXX_FLAGS_SEMIDEBUG
19 CMAKE_C_FLAGS_SEMIDEBUG
21 set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
22 "Choose the type of build. Options are: None Debug SemiDebug RelWithDebInfo MinSizeRel."
27 # Set some random things default to not being visible in the GUI
28 mark_as_advanced(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
31 if(NOT (BUILD_CLIENT OR BUILD_SERVER))
32 message(WARNING "Neither BUILD_CLIENT nor BUILD_SERVER is set! Setting BUILD_SERVER=true")
33 set(BUILD_SERVER TRUE)
37 option(ENABLE_CURL "Enable cURL support for fetching media" TRUE)
43 message(STATUS "cURL support enabled.")
47 mark_as_advanced(CLEAR CURL_LIBRARY CURL_INCLUDE_DIR)
52 message(WARNING "cURL is required to load the server list")
55 message(WARNING "cURL is required to announce to the server list")
60 option(ENABLE_GETTEXT "Use GetText for internationalization" FALSE)
61 set(USE_GETTEXT FALSE)
64 find_package(GettextLib)
67 message(STATUS "GetText library: ${GETTEXT_LIBRARY}")
68 message(STATUS "GetText DLL: ${GETTEXT_DLL}")
69 message(STATUS "GetText iconv DLL: ${GETTEXT_ICONV_DLL}")
72 message(STATUS "GetText enabled; locales found: ${GETTEXT_AVAILABLE_LOCALES}")
75 mark_as_advanced(GETTEXT_ICONV_DLL GETTEXT_INCLUDE_DIR GETTEXT_LIBRARY GETTEXT_MSGFMT)
76 message(STATUS "GetText disabled.")
80 option(ENABLE_SOUND "Enable sound" TRUE)
83 if(BUILD_CLIENT AND ENABLE_SOUND)
88 message(STATUS "Sound enabled, but OpenAL not found!")
89 mark_as_advanced(CLEAR OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
92 message(STATUS "Sound enabled, but Vorbis libraries not found!")
93 mark_as_advanced(CLEAR OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
95 if(OPENAL_FOUND AND VORBIS_FOUND)
97 message(STATUS "Sound enabled.")
99 message(FATAL_ERROR "Sound enabled, but cannot be used.\n"
100 "To continue, either fill in the required paths or disable sound. (-DENABLE_SOUND=0)")
105 set(sound_SRCS sound_openal.cpp)
106 set(SOUND_INCLUDE_DIRS
107 ${OPENAL_INCLUDE_DIR}
108 ${VORBIS_INCLUDE_DIR}
118 option(ENABLE_GLES "Enable OpenGL ES support" FALSE)
119 mark_as_advanced(ENABLE_GLES)
121 find_package(OpenGLES2)
125 option(ENABLE_FREETYPE "Enable FreeType2 (TrueType fonts and basic unicode support)" TRUE)
126 set(USE_FREETYPE FALSE)
130 ## Note: FindFreetype.cmake seems to have been fixed in recent versions of
131 ## CMake. If issues persist, re-enable this workaround specificially for the
132 ## failing platforms.
135 # include(FindPkgConfig)
136 # if(PKG_CONFIG_FOUND)
137 # pkg_check_modules(FREETYPE QUIET freetype2)
139 # SET(FREETYPE_PKGCONFIG_FOUND TRUE)
140 # SET(FREETYPE_LIBRARY ${FREETYPE_LIBRARIES})
141 # # Because CMake is idiotic
142 # string(REPLACE ";" " " FREETYPE_CFLAGS_STR ${FREETYPE_CFLAGS})
143 # string(REPLACE ";" " " FREETYPE_LDFLAGS_STR ${FREETYPE_LDFLAGS})
144 # endif(FREETYPE_FOUND)
145 # endif(PKG_CONFIG_FOUND)
147 # if(NOT FREETYPE_FOUND)
148 # find_package(Freetype)
150 find_package(Freetype)
152 message(STATUS "Freetype enabled.")
153 set(USE_FREETYPE TRUE)
154 set(CGUITTFONT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cguittfont")
155 set(CGUITTFONT_LIBRARY cguittfont)
157 endif(ENABLE_FREETYPE)
159 option(ENABLE_CURSES "Enable ncurses console" TRUE)
160 set(USE_CURSES FALSE)
163 find_package(Ncursesw)
166 message(STATUS "ncurses console enabled.")
167 include_directories(${CURSES_INCLUDE_DIRS})
169 message(STATUS "ncurses not found!")
173 option(ENABLE_POSTGRESQL "Enable PostgreSQL backend" TRUE)
174 set(USE_POSTGRESQL FALSE)
176 if(ENABLE_POSTGRESQL)
177 find_program(POSTGRESQL_CONFIG_EXECUTABLE pg_config DOC "pg_config")
178 find_library(POSTGRESQL_LIBRARY pq)
179 if(POSTGRESQL_CONFIG_EXECUTABLE)
180 execute_process(COMMAND ${POSTGRESQL_CONFIG_EXECUTABLE} --includedir-server
181 OUTPUT_VARIABLE POSTGRESQL_SERVER_INCLUDE_DIRS
182 OUTPUT_STRIP_TRAILING_WHITESPACE)
183 execute_process(COMMAND ${POSTGRESQL_CONFIG_EXECUTABLE}
184 OUTPUT_VARIABLE POSTGRESQL_CLIENT_INCLUDE_DIRS
185 OUTPUT_STRIP_TRAILING_WHITESPACE)
186 # This variable is case sensitive for the cmake PostgreSQL module
187 set(PostgreSQL_ADDITIONAL_SEARCH_PATHS ${POSTGRESQL_SERVER_INCLUDE_DIRS} ${POSTGRESQL_CLIENT_INCLUDE_DIRS})
190 find_package("PostgreSQL")
193 set(USE_POSTGRESQL TRUE)
194 message(STATUS "PostgreSQL backend enabled")
195 # This variable is case sensitive, don't try to change it to POSTGRESQL_INCLUDE_DIR
196 message(STATUS "PostgreSQL includes: ${PostgreSQL_INCLUDE_DIR}")
197 include_directories(${PostgreSQL_INCLUDE_DIR})
199 message(STATUS "PostgreSQL not found!")
201 endif(ENABLE_POSTGRESQL)
203 option(ENABLE_LEVELDB "Enable LevelDB backend" TRUE)
204 set(USE_LEVELDB FALSE)
207 find_library(LEVELDB_LIBRARY leveldb)
208 find_path(LEVELDB_INCLUDE_DIR db.h PATH_SUFFIXES leveldb)
209 if(LEVELDB_LIBRARY AND LEVELDB_INCLUDE_DIR)
210 set(USE_LEVELDB TRUE)
211 message(STATUS "LevelDB backend enabled.")
212 include_directories(${LEVELDB_INCLUDE_DIR})
214 message(STATUS "LevelDB not found!")
216 endif(ENABLE_LEVELDB)
219 OPTION(ENABLE_REDIS "Enable Redis backend" TRUE)
223 find_library(REDIS_LIBRARY hiredis)
224 find_path(REDIS_INCLUDE_DIR hiredis.h PATH_SUFFIXES hiredis)
225 if(REDIS_LIBRARY AND REDIS_INCLUDE_DIR)
227 message(STATUS "Redis backend enabled.")
228 include_directories(${REDIS_INCLUDE_DIR})
229 else(REDIS_LIBRARY AND REDIS_INCLUDE_DIR)
230 message(STATUS "Redis not found!")
231 endif(REDIS_LIBRARY AND REDIS_INCLUDE_DIR)
235 find_package(SQLite3 REQUIRED)
237 OPTION(ENABLE_SPATIAL "Enable SpatialIndex AreaStore backend" TRUE)
238 set(USE_SPATIAL FALSE)
241 find_library(SPATIAL_LIBRARY spatialindex)
242 find_path(SPATIAL_INCLUDE_DIR spatialindex/SpatialIndex.h)
243 if(SPATIAL_LIBRARY AND SPATIAL_INCLUDE_DIR)
244 set(USE_SPATIAL TRUE)
245 message(STATUS "SpatialIndex AreaStore backend enabled.")
246 include_directories(${SPATIAL_INCLUDE_DIR})
247 else(SPATIAL_LIBRARY AND SPATIAL_INCLUDE_DIR)
248 message(STATUS "SpatialIndex not found!")
249 endif(SPATIAL_LIBRARY AND SPATIAL_INCLUDE_DIR)
250 endif(ENABLE_SPATIAL)
254 set(USE_GPROF FALSE CACHE BOOL "Use -pg flag for g++")
258 add_definitions(-DUSE_CMAKE_CONFIG_H)
262 if(MSVC) # MSVC Specifics
263 set(PLATFORM_LIBS dbghelp.lib ${PLATFORM_LIBS})
264 # Surpress some useless warnings
265 add_definitions ( /D "_CRT_SECURE_NO_DEPRECATE" /W1 )
267 add_definitions(/D "_USE_MATH_DEFINES")
268 else() # Probably MinGW = GCC
269 set(PLATFORM_LIBS "")
271 set(PLATFORM_LIBS ws2_32.lib shlwapi.lib ${PLATFORM_LIBS})
274 set(ZLIB_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/../../zlib/zlib-1.2.5"
275 CACHE PATH "Zlib include directory")
276 set(ZLIB_LIBRARIES "${PROJECT_SOURCE_DIR}/../../zlib125dll/dll32/zlibwapi.lib"
277 CACHE FILEPATH "Path to zlib library (usually zlibwapi.lib)")
278 set(ZLIB_DLL "${PROJECT_SOURCE_DIR}/../../zlib125dll/dll32/zlibwapi.dll"
279 CACHE FILEPATH "Path to zlib DLL (for installation)")
280 set(ZLIBWAPI_DLL "" CACHE FILEPATH "Path to zlibwapi DLL")
281 set(IRRLICHT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../irrlicht-1.7.2"
282 CACHE PATH "irrlicht dir")
284 set(FREETYPE_INCLUDE_DIR_ft2build "${PROJECT_SOURCE_DIR}/../../freetype2/include/"
285 CACHE PATH "freetype include dir")
286 set(FREETYPE_INCLUDE_DIR_freetype2 "${PROJECT_SOURCE_DIR}/../../freetype2/include/freetype"
287 CACHE PATH "freetype include dir")
288 set(FREETYPE_LIBRARY "${PROJECT_SOURCE_DIR}/../../freetype2/objs/win32/vc2005/freetype247.lib"
289 CACHE FILEPATH "Path to freetype247.lib")
292 set(OPENAL_DLL "" CACHE FILEPATH "Path to OpenAL32.dll for installation (optional)")
293 set(OGG_DLL "" CACHE FILEPATH "Path to libogg.dll for installation (optional)")
294 set(VORBIS_DLL "" CACHE FILEPATH "Path to libvorbis.dll for installation (optional)")
295 set(VORBISFILE_DLL "" CACHE FILEPATH "Path to libvorbisfile.dll for installation (optional)")
300 find_package(X11 REQUIRED)
301 find_package(OpenGL REQUIRED)
302 find_package(JPEG REQUIRED)
303 find_package(BZip2 REQUIRED)
304 find_package(PNG REQUIRED)
306 find_library(CARBON_LIB Carbon)
307 find_library(COCOA_LIB Cocoa)
308 find_library(IOKIT_LIB IOKit)
314 SET(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${CARBON_LIB} ${COCOA_LIB} ${IOKIT_LIB})
317 find_package(ZLIB REQUIRED)
318 set(PLATFORM_LIBS -lpthread ${CMAKE_DL_LIBS})
320 set(PLATFORM_LIBS "-framework CoreFoundation" ${PLATFORM_LIBS})
322 check_library_exists(rt clock_gettime "" HAVE_LIBRT)
324 set(PLATFORM_LIBS -lrt ${PLATFORM_LIBS})
328 # This way Xxf86vm is found on OpenBSD too
329 find_library(XXF86VM_LIBRARY Xxf86vm)
330 mark_as_advanced(XXF86VM_LIBRARY)
331 set(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY})
333 # Prefer local iconv if installed
334 find_library(ICONV_LIBRARY iconv)
335 mark_as_advanced(ICONV_LIBRARY)
337 set(PLATFORM_LIBS ${PLATFORM_LIBS} ${ICONV_LIBRARY})
341 check_include_files(endian.h HAVE_ENDIAN_H)
344 "${PROJECT_SOURCE_DIR}/cmake_config.h.in"
345 "${PROJECT_BINARY_DIR}/cmake_config.h"
349 # Add a target that always rebuilds cmake_config_githash.h
350 add_custom_target(GenerateVersion
351 COMMAND ${CMAKE_COMMAND}
352 -D "GENERATE_VERSION_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
353 -D "GENERATE_VERSION_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}"
354 -D "VERSION_STRING=${VERSION_STRING}"
355 -D "DEVELOPMENT_BUILD=${DEVELOPMENT_BUILD}"
356 -P "${CMAKE_SOURCE_DIR}/cmake/Modules/GenerateVersion.cmake"
357 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
360 add_subdirectory(threading)
361 add_subdirectory(network)
362 add_subdirectory(script)
363 add_subdirectory(unittest)
364 add_subdirectory(util)
365 add_subdirectory(irrlicht_changes)
381 database-postgresql.cpp
397 itemstackmetadata.cpp
401 map_settings_manager.cpp
406 mapgen_singlenode.cpp
425 object_properties.cpp
435 rollback_interface.cpp
438 serverenvironment.cpp
446 terminal_chat_console.cpp
453 ${common_network_SRCS}
455 ${common_SCRIPT_SRCS}
461 # This gives us the icon and file version information
463 set(WINRESOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../misc/winresource.rc")
464 set(MINETEST_EXE_MANIFEST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../misc/minetest.exe.manifest")
466 if(NOT CMAKE_RC_COMPILER)
467 set(CMAKE_RC_COMPILER "windres.exe")
469 ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o
470 COMMAND ${CMAKE_RC_COMPILER} -I${CMAKE_CURRENT_SOURCE_DIR} -I${CMAKE_CURRENT_BINARY_DIR}
471 -i${WINRESOURCE_FILE}
472 -o ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o
473 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
474 DEPENDS ${WINRESOURCE_FILE})
475 SET(common_SRCS ${common_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/winresource_rc.o)
476 else(MINGW) # Probably MSVC
477 set(common_SRCS ${common_SRCS} ${WINRESOURCE_FILE} ${MINETEST_EXE_MANIFEST_FILE})
484 add_subdirectory(client)
491 ${client_network_SRCS}
492 ${client_irrlicht_changes_SRCS}
495 clientenvironment.cpp
510 guiFileSelectMenu.cpp
513 guiPasswordChange.cpp
525 mesh_generator_thread.cpp
531 ${client_SCRIPT_SRCS}
532 ${UNITTEST_CLIENT_SRCS}
534 list(SORT client_SRCS)
541 list(SORT server_SRCS)
544 ${PROJECT_BINARY_DIR}
545 ${PROJECT_SOURCE_DIR}
546 ${IRRLICHT_INCLUDE_DIR}
550 ${GETTEXT_INCLUDE_DIR}
551 ${SOUND_INCLUDE_DIRS}
552 ${SQLITE3_INCLUDE_DIR}
557 ${PROJECT_SOURCE_DIR}/script
562 include_directories(${FREETYPE_INCLUDE_DIRS} ${CGUITTFONT_INCLUDE_DIR})
566 include_directories(${CURL_INCLUDE_DIR})
570 set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
574 add_executable(${PROJECT_NAME} ${client_SRCS})
575 add_dependencies(${PROJECT_NAME} GenerateVersion)
591 ${OPENGLES2_LIBRARIES}
593 ${CLIENT_PLATFORM_LIBS}
596 target_link_libraries(
601 target_link_libraries(
606 target_link_libraries(
612 if(FREETYPE_PKGCONFIG_FOUND)
613 set_target_properties(${PROJECT_NAME}
615 COMPILE_FLAGS "${FREETYPE_CFLAGS_STR}"
618 target_link_libraries(
621 ${CGUITTFONT_LIBRARY}
625 target_link_libraries(${PROJECT_NAME} ${CURSES_LIBRARIES})
628 target_link_libraries(${PROJECT_NAME} ${POSTGRESQL_LIBRARY})
631 target_link_libraries(${PROJECT_NAME} ${LEVELDB_LIBRARY})
634 target_link_libraries(${PROJECT_NAME} ${REDIS_LIBRARY})
637 target_link_libraries(${PROJECT_NAME} ${SPATIAL_LIBRARY})
643 add_executable(${PROJECT_NAME}server ${server_SRCS})
644 add_dependencies(${PROJECT_NAME}server GenerateVersion)
645 target_link_libraries(
646 ${PROJECT_NAME}server
655 set_target_properties(${PROJECT_NAME}server PROPERTIES
656 COMPILE_DEFINITIONS "SERVER")
658 target_link_libraries(${PROJECT_NAME}server ${CURSES_LIBRARIES})
661 target_link_libraries(${PROJECT_NAME}server ${POSTGRESQL_LIBRARY})
664 target_link_libraries(${PROJECT_NAME}server ${LEVELDB_LIBRARY})
667 target_link_libraries(${PROJECT_NAME}server ${REDIS_LIBRARY})
670 target_link_libraries(${PROJECT_NAME}server ${SPATIAL_LIBRARY})
673 target_link_libraries(
674 ${PROJECT_NAME}server
680 # Blacklisted locales that don't work.
682 set(GETTEXT_BLACKLISTED_LOCALES
691 option(APPLY_LOCALE_BLACKLIST "Use a blacklist to avoid broken locales" TRUE)
693 if (GETTEXT_FOUND AND APPLY_LOCALE_BLACKLIST)
694 set(GETTEXT_USED_LOCALES "")
695 foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES})
696 if (NOT ";${GETTEXT_BLACKLISTED_LOCALES};" MATCHES ";${LOCALE};")
697 list(APPEND GETTEXT_USED_LOCALES ${LOCALE})
700 message(STATUS "Locale blacklist applied; Locales used: ${GETTEXT_USED_LOCALES}")
703 # Set some optimizations and tweaks
705 include(CheckCXXCompilerFlag)
710 # EHa enables SEH exceptions (used for catching segfaults)
711 set(CMAKE_CXX_FLAGS_RELEASE "/EHa /Ox /GL /FD /MT /GS- /Zi /arch:SSE /fp:fast /D NDEBUG /D _HAS_ITERATOR_DEBUGGING=0 /TP")
712 #set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG /NODEFAULTLIB:\"libcmtd.lib\" /NODEFAULTLIB:\"libcmt.lib\"")
713 set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG /INCREMENTAL:NO /DEBUG /OPT:REF /OPT:ICF")
716 set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
719 set(CMAKE_CXX_FLAGS_SEMIDEBUG "/MDd /Zi /Ob0 /O1 /RTC1")
721 # Debug build doesn't catch exceptions by itself
722 # Add some optimizations because otherwise it's VERY slow
723 set(CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1")
725 # Flags for C files (sqlite)
726 # /MT = Link statically with standard library stuff
727 set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /MT")
731 SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000" )
734 set(RELEASE_WARNING_FLAGS "-Wall")
736 set(RELEASE_WARNING_FLAGS "")
739 if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
740 # clang does not understand __extern_always_inline but libc headers use it
741 set(OTHER_FLAGS "${OTHER_FLAGS} \"-D__extern_always_inline=extern __always_inline\"")
742 set(OTHER_FLAGS "${OTHER_FLAGS} -Wsign-compare")
745 if(WIN32 AND NOT ZLIBWAPI_DLL AND CMAKE_SIZEOF_VOID_P EQUAL 4)
746 set(OTHER_FLAGS "${OTHER_FLAGS} -DWIN32_NO_ZLIB_WINAPI")
747 message(WARNING "Defaulting to cdecl for zlib on win32 because ZLIBWAPI_DLL"
748 " isn't set, ensure that ZLIBWAPI_DLL is set if you want stdcall.")
752 set(OTHER_FLAGS "${OTHER_FLAGS} -mthreads -fexceptions")
755 set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} ${OTHER_FLAGS} -ffast-math -Wall -pipe -funroll-loops")
757 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os")
759 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer")
761 set(CMAKE_CXX_FLAGS_SEMIDEBUG "-g -O1 -Wall -Wabi ${WARNING_FLAGS} ${OTHER_FLAGS}")
762 set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wabi ${WARNING_FLAGS} ${OTHER_FLAGS}")
765 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg")
769 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mwindows")
779 install(FILES ${OPENAL_DLL} DESTINATION ${BINDIR})
782 install(FILES ${OGG_DLL} DESTINATION ${BINDIR})
785 install(FILES ${VORBIS_DLL} DESTINATION ${BINDIR})
788 install(FILES ${VORBISFILE_DLL} DESTINATION ${BINDIR})
792 install(FILES ${CURL_DLL} DESTINATION ${BINDIR})
795 install(FILES ${ZLIB_DLL} DESTINATION ${BINDIR})
798 install(FILES ${ZLIBWAPI_DLL} DESTINATION ${BINDIR})
801 install(FILES ${FREETYPE_DLL} DESTINATION ${BINDIR})
804 install(FILES ${SQLITE3_DLL} DESTINATION ${BINDIR})
807 install(FILES ${LEVELDB_DLL} DESTINATION ${BINDIR})
812 install(TARGETS ${PROJECT_NAME}
813 RUNTIME DESTINATION ${BINDIR}
814 LIBRARY DESTINATION ${BINDIR}
815 ARCHIVE DESTINATION ${BINDIR}
821 set(BU_CHMOD_BUNDLE_ITEMS ON)
822 include(BundleUtilities)
823 fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${BUNDLE_PATH}\" \"\" \"\${CMAKE_INSTALL_PREFIX}/${BINDIR}\")
828 foreach(LOCALE ${GETTEXT_USED_LOCALES})
829 set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE})
830 set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo")
831 install(FILES ${MO_BUILD_PATH} DESTINATION ${MO_DEST_PATH})
836 if(DEFINED IRRLICHT_DLL)
837 install(FILES ${IRRLICHT_DLL} DESTINATION ${BINDIR})
840 if(DEFINED GETTEXT_DLL)
841 install(FILES ${GETTEXT_DLL} DESTINATION ${BINDIR})
843 if(DEFINED GETTEXT_ICONV_DLL)
844 install(FILES ${GETTEXT_ICONV_DLL} DESTINATION ${BINDIR})
851 install(TARGETS ${PROJECT_NAME}server DESTINATION ${BINDIR})
857 foreach(LOCALE ${GETTEXT_USED_LOCALES})
858 set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/${PROJECT_NAME}.po")
859 set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE})
860 set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo")
862 add_custom_command(OUTPUT ${MO_BUILD_PATH}
863 COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH}
864 COMMENT "mo-update [${LOCALE}]: Creating locale directory.")
867 OUTPUT ${MO_FILE_PATH}
868 COMMAND ${GETTEXT_MSGFMT} -o ${MO_FILE_PATH} ${PO_FILE_PATH}
869 DEPENDS ${MO_BUILD_PATH} ${PO_FILE_PATH}
870 WORKING_DIRECTORY "${GETTEXT_PO_PATH}/${LOCALE}"
871 COMMENT "mo-update [${LOCALE}]: Creating mo file."
874 set(MO_FILES ${MO_FILES} ${MO_FILE_PATH})
877 add_custom_target(translations ALL COMMENT "mo update" DEPENDS ${MO_FILES})
883 if (BUILD_CLIENT AND USE_FREETYPE)
884 add_subdirectory(cguittfont)