X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=po%2FCMakeLists.txt;h=590921cd6c52d3e24bac2a84513598c1140872c7;hb=97aea7e5b1707d662d6d7146d53adc97045c44c9;hp=3f2f9ad7e781f7713750b3cb4f640fb8934df89e;hpb=b917c4e40f9f5cd3d101444600eddafcca54d6e3;p=lyx.git diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 3f2f9ad7e7..590921cd6c 100755 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -11,6 +11,7 @@ include_directories(${TOP_SRC_DIR}/po) SET(_lyxname ${PACKAGE}) SET(_py_sources) + macro(add_gettext_python _par _dir) set(_sources) foreach(_arg ${ARGN}) @@ -40,13 +41,23 @@ macro(add_gettext_python _par _dir) DEPENDS ${_tmp_src_files} ) if (${_par} MATCHES "layouttranslations") + # lyx_pot.py requires the module "polib" if using target layouttranslations1, + # so we have to check for it + find_python_module("polib") + if ("${LYX_PY_POLIB}" STREQUAL "") + message(STATUS "You will be unable to update layouttranslations file") + endif() ADD_CUSTOM_COMMAND( OUTPUT "${_dst}" PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${TOP_SRC_DIR}/lib/layouttranslations" "${_dst}" - COMMAND ${LYX_PYTHON_EXECUTABLE} - ARGS "${TOP_SRC_DIR}/po/lyx_pot.py" -b "${TOP_SRC_DIR}" -o "${_dst}" -t ${_par1} "--src_file=${_src_files}" - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_dst}" "${TOP_SRC_DIR}/lib/layouttranslations" + COMMAND ${CMAKE_COMMAND} + "-DTOP_SRC_DIR=${TOP_SRC_DIR}" + "-DDestFile=${_dst}" + "-DLYX_PYTHON_EXECUTABLE=${LYX_PYTHON_EXECUTABLE}" + "-DParType=${_par1}" + "-DSources=${_src_files}" + "-DLYX_PY_POLIB=${LYX_PY_POLIB}" + -P "${TOP_SRC_DIR}/po/CreateLayoutTranslations.cmake" DEPENDS ${_sources} ${_src_files} "${TOP_SRC_DIR}/lib/layouttranslations" COMMENT "${LYX_PYTHON_EXECUTABLE} ${TOP_SRC_DIR}/po/lyx_pot.py -b ${TOP_SRC_DIR} -o ${_dst} -t ${_par1} --src_file=${_src_files}" )