--- a/translations/CMakeLists.txt
+++ b/translations/CMakeLists.txt
@@ -73,7 +73,7 @@
 
 add_custom_command(TARGET generate_translations_header
   POST_BUILD
-  COMMAND $<TARGET_FILE:generate_translations_header> ${qm_files}
+  COMMAND generate_translations_header_for_build ${qm_files}
   WORKING_DIRECTORY "${CMAKE_CURRENT_BIN_DIR}"
   COMMENT "Generating embedded translations header")
 
