Warning, /office/alkimia/cmake/modules/build-tsfiles.cmake is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2017 Aleix Pol Gonzalez <aleixpol@kde.org>
0002 #
0003 # SPDX-License-Identifier: BSD-3-Clause
0004 
0005 file(GLOB_RECURSE ts_files RELATIVE ${PO_DIR} ${PO_DIR}/**/scripts/*)
0006 foreach(ts_file ${ts_files})
0007     if(ts_file MATCHES "\\.svn")
0008         continue()
0009     endif()
0010 
0011     get_filename_component(subpath ${ts_file} DIRECTORY)
0012     string(REPLACE "scripts" "LC_SCRIPTS" subpath ${subpath})
0013 
0014     message(STATUS "copying... ${PO_DIR}/${ts_file} DESTINATION ${COPY_TO}/${subpath}" )
0015     file(COPY ${PO_DIR}/${ts_file} DESTINATION ${COPY_TO}/${subpath})
0016 endforeach()
0017 
0018 
0019 include(ProcessorCount)
0020 ProcessorCount(numberOfProcesses)
0021 
0022 set(i 0)
0023 set(commands)
0024 
0025 function(_processCommands)
0026     if(NOT commands)
0027         return()
0028     endif()
0029 
0030     execute_process(
0031         ${commands}
0032         RESULT_VARIABLE code
0033     )
0034     if(code)
0035         message(FATAL_ERROR "failed generating: ${PO_DIR}")
0036     endif()
0037 endfunction()
0038 
0039 file(GLOB_RECURSE pmap_files RELATIVE ${PO_DIR} "${PO_DIR}/**.pmap")
0040 foreach(pmap_file ${pmap_files})
0041     get_filename_component(pmap_basename ${pmap_file} NAME)
0042     get_filename_component(subpath ${pmap_file} DIRECTORY)
0043     string(REPLACE "scripts" "LC_SCRIPTS" subpath ${subpath})
0044     set(pmapc_file "${COPY_TO}/${subpath}/${pmap_basename}c")
0045 
0046     message(STATUS "building... ${pmap_file} to ${pmapc_file}" )
0047     list(APPEND commands
0048         COMMAND ${PYTHON_EXECUTABLE}
0049             -B
0050             ${_ki18n_pmap_compile_script}
0051             ${PO_DIR}/${pmap_file}
0052             ${pmapc_file}
0053     )
0054     math(EXPR i "${i}+1")
0055     if (i EQUAL ${numberOfProcesses})
0056         _processCommands()
0057         set(i 0)
0058     endif()
0059 endforeach()
0060 
0061 _processCommands()