initial commit
Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
36
libs/wxWidgets-3.3.1/build/cmake/locale/CMakeLists.txt
Normal file
36
libs/wxWidgets-3.3.1/build/cmake/locale/CMakeLists.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
if(wxBUILD_LOCALES STREQUAL "AUTO")
|
||||
find_package(Gettext QUIET)
|
||||
elseif(wxBUILD_LOCALES)
|
||||
find_package(Gettext REQUIRED)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(GETTEXT_MSGMERGE_EXECUTABLE)
|
||||
mark_as_advanced(GETTEXT_MSGFMT_EXECUTABLE)
|
||||
|
||||
if(NOT GETTEXT_FOUND OR wxBUILD_LOCALES STREQUAL "OFF")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# list and process the po files
|
||||
file(GLOB _po_files "${wxSOURCE_DIR}/locale/*.po")
|
||||
foreach(_po_file ${_po_files})
|
||||
get_filename_component(name "${_po_file}" NAME)
|
||||
string(REGEX REPLACE "\\.[^.]*$" "" lang ${name})
|
||||
|
||||
gettext_process_po_files(${lang} ALL PO_FILES "${_po_file}")
|
||||
|
||||
wx_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lang}.gmo"
|
||||
DESTINATION "share/locale/${lang}/LC_MESSAGES"
|
||||
RENAME "wxstd-${wxMAJOR_VERSION}.${wxMINOR_VERSION}.mo"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# put all pofiles targets in a group to not clutter visual studio
|
||||
set(base_name "pofiles")
|
||||
set(target_index 0)
|
||||
set(target_name ${base_name})
|
||||
while(TARGET ${target_name})
|
||||
set_target_properties(${target_name} PROPERTIES FOLDER "Locales")
|
||||
math(EXPR target_index "${target_index}+1")
|
||||
set(target_name "${base_name}_${target_index}")
|
||||
endwhile()
|
||||
Reference in New Issue
Block a user