Warning, /frameworks/ki18n/cmake/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     if (EXISTS ${pmapc_file} AND ${pmapc_file} IS_NEWER_THAN ${pmap_file})
0047         continue()
0048     endif()
0049 
0050     message(STATUS "building... ${pmap_file} to ${pmapc_file}" )
0051     list(APPEND commands
0052         COMMAND ${Python3_EXECUTABLE}
0053             -B
0054             ${_ki18n_pmap_compile_script}
0055             ${PO_DIR}/${pmap_file}
0056             ${pmapc_file}
0057     )
0058     math(EXPR i "${i}+1")
0059     if (i EQUAL ${numberOfProcesses})
0060         _processCommands()
0061         set(i 0)
0062     endif()
0063 endforeach()
0064 
0065 _processCommands()