Hello everyone.

I'm moving a quite huge app in cmake from Qt4 to Qt5. So far it was quite easy however I ran into some problems when I tried adding localization. Since the projact has a lot of subfolders the translation files are handled in a separate function

Qt Code:
  1. function (create_translations TRANSLATIONS_FILE_PATH)
  2. file (GLOB_RECURSE FILES_TO_TRANSLATE
  3. "${CMAKE_CURRENT_SOURCE_DIR}/*.h"
  4. "${CMAKE_CURRENT_SOURCE_DIR}/*.cc"
  5. "${CMAKE_CURRENT_SOURCE_DIR}/*.ui")
  6.  
  7. file (GLOB_RECURSE TRANSLATION_FILES
  8. "${CMAKE_CURRENT_SOURCE_DIR}/*.ts")
  9.  
  10. qt5_create_translation (CURRENT_TRANSLATIONS_FILE_PATH
  11. "${FILES_TO_TRANSLATE}"
  12. "${TRANSLATION_FILES}")
  13.  
  14. set ("${TRANSLATIONS_FILE_PATH}"
  15. "${CURRENT_TRANSLATIONS_FILE_PATH}"
  16. PARENT_SCOPE)
  17. endfunction ()
To copy to clipboard, switch view to plain text mode 
And in the proper CMakeLists.txt files there is something like
Qt Code:
  1. create_translations (MY_TRANSLATIONS)
  2. install (FILES ${MY_TRANSLATIONS}
  3. DESTINATION "${TARGET_TRANSLATIONS_INSTALL_PATH}")
To copy to clipboard, switch view to plain text mode 

The cmake runs well and .qm files are properly created. However the make fails almost immediately with the following error

/bin/sh: 1: @/home/path/to/build/someapp/CMakeFiles/someapp_ru_lst_file: not found someapp/CMakeFiles/someapp.dir/build.make:88: recipe for target '/home/path/to/sources/translations/someapp_ru.ts' failed
make[2]: * [/home/path/to/sources/translations/someapp_ru.ts] Error 127
make[1]: * [someapp/CMakeFiles/someapp.dir/all] Error 2 CMakeFiles/Makefile2:608: recipe for target 'someapp/CMakeFiles/someapp.dir/all' failed
The curious thing is that the file /home/path/to/build/someapp/CMakeFiles/someapp_ru_lst_file that is reported missing actually exists, so I have no idea what went wrong