Skip to content
Snippets Groups Projects
Commit fa59e59e authored by Julien Malik's avatar Julien Malik
Browse files

ENH: move the cmake get_qt_translation_files function, to be used for MacOS bundle too

parent 89c33e3d
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,25 @@ mark_as_advanced(Monteverdi2_USE_CPACK)
if( Monteverdi2_USE_CPACK )
# Get the translation files coming with Qt, and install them in the bundle
# They are loaded by Monteverdi2.
function(get_qt_translation_files RESULT)
# These files are the "qt_<localename>.qm" files
# They are located in QT_TRANSLATIONS_DIR, which comes from FindQt4
file(GLOB translation_files ${QT_TRANSLATIONS_DIR}/qt_*)
# We need to remove the "qt_help_<localename>.qm" files from this list
foreach(translation_item ${translation_files})
if(${translation_item} MATCHES "qt_help")
list(REMOVE_ITEM translation_files ${translation_item})
endif()
endforeach()
set(${RESULT} ${translation_files} PARENT_SCOPE)
endfunction()
get_qt_translation_files(QT_TRANSLATIONS_FILES)
set(CPACK_PACKAGE_NAME "Monteverdi2")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Monteverdi2")
......
......@@ -34,25 +34,6 @@ install(DIRECTORY ${GDAL_DATA}
DESTINATION share
COMPONENT Resources)
# Get the translation files coming with qt, and install them in the bundle
# They are loaded by Monteverdi2.
function(get_qt_translation_files RESULT)
# These files are the "qt_<localename>.qm" files
# They are located in QT_TRANSLATIONS_DIR, which comes from FindQt4
file(GLOB translation_files ${QT_TRANSLATIONS_DIR}/qt_*)
# We need to remove the "qt_help_<localename>.qm" files from this list
foreach(translation_item ${translation_files})
if(${translation_item} MATCHES "qt_help")
list(REMOVE_ITEM translation_files ${translation_item})
endif()
endforeach()
set(${RESULT} ${translation_files} PARENT_SCOPE)
endfunction()
get_qt_translation_files(QT_TRANSLATIONS_FILES)
install(FILES ${QT_TRANSLATIONS_FILES}
DESTINATION share/qt4/translations
COMPONENT Resources)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment