diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,8 +53,10 @@ find_package(PythonInterp REQUIRED) configure_file(cmake/KF5I18NMacros.cmake.in ${KI18n_BINARY_DIR}/cmake/KF5I18NMacros.cmake @ONLY) # Needed to build the ki18n translations and run the autotests -file(COPY ${KI18n_SOURCE_DIR}/cmake/ts-pmap-compile.py DESTINATION ${KI18n_BINARY_DIR}/cmake) -file(COPY ${KI18n_SOURCE_DIR}/cmake/kf5i18nuic.cmake DESTINATION ${KI18n_BINARY_DIR}/cmake) +configure_file(${KI18n_SOURCE_DIR}/cmake/build-pofiles.cmake ${KI18n_BINARY_DIR}/cmake/build-pofiles.cmake COPYONLY) +configure_file(${KI18n_SOURCE_DIR}/cmake/build-tsfiles.cmake ${KI18n_BINARY_DIR}/cmake/build-tsfiles.cmake COPYONLY) +configure_file(${KI18n_SOURCE_DIR}/cmake/ts-pmap-compile.py ${KI18n_BINARY_DIR}/cmake/ts-pmap-compile.py COPYONLY) +configure_file(${KI18n_SOURCE_DIR}/cmake/kf5i18nuic.cmake ${KI18n_BINARY_DIR}/cmake/kf5i18nuic.cmake COPYONLY) # usually is called using find_package(KF5I18n), # KF5I18NMacros.cmake needs to know the scripts directory diff --git a/cmake/KF5I18NMacros.cmake.in b/cmake/KF5I18NMacros.cmake.in --- a/cmake/KF5I18NMacros.cmake.in +++ b/cmake/KF5I18NMacros.cmake.in @@ -31,6 +31,8 @@ set(_ki18n_pmap_compile_script ${CMAKE_CURRENT_LIST_DIR}/ts-pmap-compile.py) set(_ki18n_uic_script ${CMAKE_CURRENT_LIST_DIR}/kf5i18nuic.cmake) +set(_ki18n_build_pofiles_script ${CMAKE_CURRENT_LIST_DIR}/build-pofiles.cmake) +set(_ki18n_build_tsfiles_script ${CMAKE_CURRENT_LIST_DIR}/build-tsfiles.cmake) #create the implementation files from the ui files and add them to the list of sources #usage: KI18N_WRAP_UI(foo_SRCS ${ui_files}) @@ -111,16 +113,16 @@ -DGETTEXT_MSGFMT_EXECUTABLE=${GETTEXT_MSGFMT_EXECUTABLE} -DCOPY_TO=${CMAKE_CURRENT_BINARY_DIR}/${dirname} -DPO_DIR=${absolute_podir} - -P ${KF5I18n_DIR}/build-pofiles.cmake + -P ${_ki18n_build_pofiles_script} ) add_custom_target(tsfiles-${pathmd5} ALL COMMENT "Generating ts..." COMMAND ${CMAKE_COMMAND} -DPYTHON_EXECUTABLE=${KI18N_PYTHON_EXECUTABLE} -D_ki18n_pmap_compile_script=${_ki18n_pmap_compile_script} -DCOPY_TO=${CMAKE_CURRENT_BINARY_DIR}/${dirname} -DPO_DIR=${absolute_podir} - -P ${KF5I18n_DIR}/build-tsfiles.cmake + -P ${_ki18n_build_tsfiles_script} ) if (NOT TARGET pofiles)