<div dir="ltr">Hi,<br><br>I am trying to get cmake to execute the translations command without success...<br><br>Originally I just had an install(FILES etc) command (see below) but make would complain:<br><br>&gt; make ...<br>
build build build...<br>Install the project...<br>-- Install configuration: &quot;Debug&quot;<br>CMake Error at cmake_install.cmake:36 (FILE):<br>&nbsp; file INSTALL cannot find file<br>&nbsp; &quot;/builddir/app_fr.qm&quot; to<br>
&nbsp; install.<br><br>So I tried to add in dependencies to force the command to execute:<br><br><br>I have a root CMakeLists.txt:<br>---------------------------------<br>set (FILES_TO_TRANSLATE )<br>add_custom_target (translations_target)<br>
<br>add_subdirectory(app_library)<br>add_subdirectory(app_executable)<br><br>file (GLOB TRANSLATIONS_FILES translations/*.ts)<br>qt4_create_translation(QM_FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES})<br>add_dependencies(translations_target ${QM_FILES})<br>
install(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/translations)<br>---------------------------------<br><br>and in app_library/CMakeLists.txt<br>---------------------<br>file (GLOB CPPFILES *.cpp)<br>set (FILES_TO_TRANSLATE ${FILES_TO_TRANSLATE} ${CPPFILES} PARENT_SCOPE)<br>
------------------<br><br>and in app_executable/CMakeLists.txt<br>----------------<br>add_executable(myapp main.cpp)<br>add_dependencies(myapp translations_target)<br>--------------<br><br>The FILES_TO_TRANSLATE has the right files once it gets to the qt4_create_translation() command.<br>
<br>It seems that the lrelease command is never executed, the .qm file is never generated and thus there is no .qm file to install.<br><br>any ideas on how I can figure this out?<br><br>thanks,<br>Paul<br><br><br></div>