Files
cmake_common/python.cmake
T

31 lines
696 B
CMake
Raw Normal View History

2020-04-24 21:39:29 -04:00
include(${CMAKE_CURRENT_LIST_DIR}/helpers/PyQt5TranslationMacros.cmake)
macro(do_python_project)
find_package(Qt5LinguistTools)
if(${create_translations})
file(GLOB_RECURSE objects LIST_DIRECTORIES true ${CMAKE_SOURCE_DIR}/src/*)
set(dirs "")
foreach(o ${objects})
if(IS_DIRECTORY ${o})
list(APPEND dirs ${o})
endif()
endforeach()
2020-04-24 21:39:29 -04:00
pyqt5_create_translation(
qm_files
${CMAKE_SOURCE_DIR}/src ${dirs} ${additional_translations}
2020-04-25 00:53:33 -04:00
${CMAKE_SOURCE_DIR}/src/${PROJECT_NAME}_en.ts
2020-04-24 21:39:29 -04:00
)
endif()
add_custom_target(translations ALL DEPENDS ${qm_files})
2020-04-24 21:39:29 -04:00
file(GLOB_RECURSE source_files CONFIGURE_DEPENDS *.py)
set(input_files
${source_files}
${qm_files})
endmacro()