fix CMake "qt_install_lang()"
This commit is contained in:
@@ -94,12 +94,12 @@ e.g. "qt_install(LANG my_QM DESTINATION QtLang)"
|
||||
|
||||
|
||||
|
||||
qt_install_lang(<name> DESTINATION <dir>)
|
||||
qt_install_lang(<name> DESTINATION <dir> [PATHS <path0> [<path1>] [...] ])
|
||||
|
||||
Search Qt translations for all <name> dependencies
|
||||
in Qt<?>_LANG_DIR for <name>_LANG languages
|
||||
and install them to <dir>. You can you "set_lang()" macro
|
||||
before this action
|
||||
and install them to <dir>. PATH are additional search paths.
|
||||
You should use "set_lang()" macro before this action
|
||||
|
||||
]]
|
||||
|
||||
@@ -665,9 +665,25 @@ macro(qt_install)
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(qt_install_lang _NAME _dest_tag _DEST)
|
||||
macro(qt_install_lang _NAME)
|
||||
set(_prev_inst)
|
||||
#message("command: ${ARGN}")
|
||||
set(_PATHS)
|
||||
set(_DEST)
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
list(APPEND _PATHS "${CMAKE_PREFIX_PATH}/lang")
|
||||
endif()
|
||||
set(_cur_arg)
|
||||
set(__args "DESTINATION;PATHS")
|
||||
foreach(_i ${ARGN})
|
||||
if (_i IN_LIST __args)
|
||||
set(_cur_arg "${_i}")
|
||||
elseif("${_cur_arg}" STREQUAL "DESTINATION")
|
||||
set(_DEST "${_i}")
|
||||
elseif("${_cur_arg}" STREQUAL "PATHS")
|
||||
list(APPEND _PATHS "${_i}")
|
||||
endif()
|
||||
endforeach()
|
||||
foreach(_v ${_QT_VERSIONS_})
|
||||
if (LOCAL_FOUND${_v})
|
||||
set(_target)
|
||||
@@ -702,7 +718,8 @@ macro(qt_install_lang _NAME _dest_tag _DEST)
|
||||
list(APPEND _qt_libs "qtbase")
|
||||
foreach (_i ${${PROJECT_NAME}_LANG})
|
||||
foreach (_l ${_qt_libs})
|
||||
set(_qm_path "${Qt${_v}_LANG_DIR}/${_l}_${_i}.qm")
|
||||
unset(_qm_path CACHE)
|
||||
find_file(_qm_path "${_l}_${_i}.qm" PATHS "${Qt${_v}_LANG_DIR}" ${_PATHS} NO_DEFAULT_PATH)
|
||||
if (EXISTS "${_qm_path}")
|
||||
install(FILES ${_qm_path} DESTINATION "${_DEST}")
|
||||
#message("qm = \"${_qm_path}\"")
|
||||
|
||||
Reference in New Issue
Block a user