]> git.lyx.org Git - lyx.git/blobdiff - po/CMakeLists.txt
bg.po: fix escaping
[lyx.git] / po / CMakeLists.txt
index 3ec0febf53b890c547e562bbb0fb0b4e6c8832b8..54d6019c5bea4d81ce18918866a98f46ca86aba9 100755 (executable)
@@ -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,6 +41,12 @@ 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
@@ -49,8 +56,9 @@ macro(add_gettext_python  _par _dir)
        "-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"
+      DEPENDS ${_sources} ${_src_files} "${TOP_SRC_DIR}/lib/layouttranslations" "${TOP_SRC_DIR}/po/lyx_pot.py"
       COMMENT "${LYX_PYTHON_EXECUTABLE} ${TOP_SRC_DIR}/po/lyx_pot.py -b ${TOP_SRC_DIR} -o  ${_dst} -t ${_par1} --src_file=${_src_files}"
       )
     ADD_CUSTOM_TARGET(layouttranslations1 DEPENDS "${_dst}")
@@ -66,7 +74,7 @@ macro(add_gettext_python  _par _dir)
       PRE_BUILD
       COMMAND ${LYX_PYTHON_EXECUTABLE}
       ARGS "${TOP_SRC_DIR}/po/lyx_pot.py" -b "${TOP_SRC_DIR}" -o "${_dst}" -t ${_par1} "--src_file=${_src_files}"
-      DEPENDS ${_sources} ${_src_files}
+      DEPENDS ${_sources} ${_src_files} "${TOP_SRC_DIR}/po/lyx_pot.py"
       COMMENT "${LYX_PYTHON_EXECUTABLE} ${TOP_SRC_DIR}/po/lyx_pot.py -b ${TOP_SRC_DIR} -o  ${_dst} -t ${_par1} --src_file=${_src_files}"
       )
     LIST(APPEND _py_sources "${_dst}")
@@ -78,16 +86,25 @@ endmacro(add_gettext_python)
 SET_SOURCE_FILES_PROPERTIES("${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.cat.pot" GENERATED)
 SET_SOURCE_FILES_PROPERTIES("${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.fmt.pot" GENERATED)
 SET_SOURCE_FILES_PROPERTIES("${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.pot" GENERATED)
+if (UNIX)
+  # create symbolic links for external lokalizations programs
+  # to be able to find the referenced sources if used on
+  # built po-files
+  foreach (_dir lib src)
+    execute_process(
+      COMMAND ${CMAKE_COMMAND} -E create_symlink "${TOP_SRC_DIR}/${_dir}" "${CMAKE_CURRENT_BINARY_DIR}/${_dir}")
+  endforeach()
+endif()
 
 add_gettext_python(qt4 src/frontends/qt4/ui *.ui)
-add_gettext_python(layouts lib/layouts *.layout *.inc *.module)
+add_gettext_python(layouts lib layouts/*.layout layouts/*.inc layouts/*.module citeengines/*.citeengine)
 add_gettext_python(languages lib languages)
 add_gettext_python(latexfonts lib latexfonts)
 add_gettext_python(encodings lib encodings)
 add_gettext_python(ui lib/ui *.ui *.inc)
-add_gettext_python(external lib external_templates)
+add_gettext_python(external lib/xtemplates *.xtemplate)
 add_gettext_python(formats lib configure.py)
-add_gettext_python(layouttranslations lib/layouts *.layout *.inc *.module)
+add_gettext_python(layouttranslations lib layouts/*.layout layouts/*.inc layouts/*.module citeengines/*.citeengine)
 
 ADD_CUSTOM_COMMAND(
     OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.cat.pot"