Apply a patch for cmake script by stikonas.
remove obsolete option for dummy locales and build them only if localedef is detected.
This commit is contained in:
parent
594ccd2ff8
commit
09551c71b1
1 changed files with 34 additions and 38 deletions
|
@ -63,7 +63,6 @@ set(PREFERENCES_DIR "" CACHE STRING "Use a non-default preferences directory (.w
|
|||
#Game options
|
||||
option(ENABLE_PYTHON "Enable in-game python extensions" ON)
|
||||
option(ENABLE_FRIBIDI "Enable FriBIDi support" ON)
|
||||
option(ENABLE_DUMMY_LOCALES "Create dummy locales")
|
||||
set(GUI "normal" CACHE STRING "Set for GUI reductions for resolutions down to 320x240 (PDAs) (normal|tiny)")
|
||||
|
||||
#server options
|
||||
|
@ -175,48 +174,45 @@ separate_arguments(LINGUAS)
|
|||
#
|
||||
|
||||
add_subdirectory(doc)
|
||||
|
||||
if (GETTEXT_FOUND AND ENABLE_NLS)
|
||||
add_subdirectory(po)
|
||||
find_program (LOCALEDEF localedef)
|
||||
if (LOCALEDEF)
|
||||
#
|
||||
#create dummy-locales
|
||||
#
|
||||
|
||||
set(DUMMY_LOCALE_C_DIR ${CMAKE_SOURCE_DIR}/locales/C)
|
||||
|
||||
add_custom_command(OUTPUT ${DUMMY_LOCALE_C_DIR}
|
||||
COMMAND mkdir -p ${DUMMY_LOCALE_C_DIR}
|
||||
&& echo | LOCALEDEF -c ${DUMMY_LOCALE_C_DIR} 2> /dev/null || true)
|
||||
|
||||
file(GLOB_RECURSE LANGS RELATIVE ${CMAKE_SOURCE_DIR}/data/languages data/languages/*.cfg)
|
||||
|
||||
set(DUMMY_LOCALES)
|
||||
foreach(LANGFILE ${LANGS})
|
||||
string(REGEX REPLACE "(.*)\\.cfg" "\\1" LANG ${LANGFILE})
|
||||
if(NOT LANG STREQUAL "C")
|
||||
set(DUMMY_LOCALE_DIR ${CMAKE_SOURCE_DIR}/locales/${LANG})
|
||||
add_custom_command(OUTPUT ${DUMMY_LOCALE_DIR}
|
||||
COMMAND ln -s
|
||||
ARGS ${DUMMY_LOCALE_C_DIR} ${DUMMY_LOCALE_DIR}
|
||||
DEPENDS ${DUMMY_LOCALE_C_DIR})
|
||||
|
||||
set(DUMMY_LOCALES ${DUMMY_LOCALES} ${DUMMY_LOCALE_DIR})
|
||||
endif()
|
||||
endforeach()
|
||||
add_custom_target(dummy-locales ALL DEPENDS ${DUMMY_LOCALES})
|
||||
|
||||
# this is a workaround for a bug in 2.4-7
|
||||
file(MAKE_DIRECTORY locales)
|
||||
install(DIRECTORY locales DESTINATION ${DATADIR} )
|
||||
endif (LOCALEDEF)
|
||||
endif (GETTEXT_FOUND AND ENABLE_NLS)
|
||||
add_subdirectory(src)
|
||||
|
||||
#
|
||||
#create dummy-locales
|
||||
#
|
||||
|
||||
if(ENABLE_DUMMY_LOCALES)
|
||||
add_definitions(-DUSE_DUMMYLOCALES)
|
||||
endif()
|
||||
|
||||
set(DUMMY_LOCALE_C_DIR ${CMAKE_SOURCE_DIR}/locales/C)
|
||||
|
||||
add_custom_command(OUTPUT ${DUMMY_LOCALE_C_DIR}
|
||||
COMMAND mkdir -p ${DUMMY_LOCALE_C_DIR}
|
||||
&& echo | localedef -c ${DUMMY_LOCALE_C_DIR} 2> /dev/null || true)
|
||||
|
||||
file(GLOB_RECURSE LANGS RELATIVE ${CMAKE_SOURCE_DIR}/data/languages data/languages/*.cfg)
|
||||
|
||||
set(DUMMY_LOCALES)
|
||||
foreach(LANGFILE ${LANGS})
|
||||
string(REGEX REPLACE "(.*)\\.cfg" "\\1" LANG ${LANGFILE})
|
||||
if(NOT LANG STREQUAL "C")
|
||||
set(DUMMY_LOCALE_DIR ${CMAKE_SOURCE_DIR}/locales/${LANG})
|
||||
add_custom_command(OUTPUT ${DUMMY_LOCALE_DIR}
|
||||
COMMAND ln -s
|
||||
ARGS ${DUMMY_LOCALE_C_DIR} ${DUMMY_LOCALE_DIR}
|
||||
DEPENDS ${DUMMY_LOCALE_C_DIR})
|
||||
|
||||
set(DUMMY_LOCALES ${DUMMY_LOCALES} ${DUMMY_LOCALE_DIR})
|
||||
endif()
|
||||
|
||||
endforeach()
|
||||
add_custom_target(dummy-locales ALL DEPENDS ${DUMMY_LOCALES})
|
||||
|
||||
# this is a workaround for a bug in 2.4-7
|
||||
file(MAKE_DIRECTORY locales)
|
||||
install(DIRECTORY locales DESTINATION ${DATADIR} )
|
||||
|
||||
|
||||
#
|
||||
# shrink images for tinygui
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue