Changeset View
Changeset View
Standalone View
Standalone View
cmake/build-pofiles.cmake
Show All 22 Lines | |||||
23 | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 23 | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
24 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 24 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
25 | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 25 | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
26 | # SUCH DAMAGE. | 26 | # SUCH DAMAGE. | ||
27 | 27 | | |||
28 | file(GLOB_RECURSE pofiles RELATIVE "${PO_DIR}" "${PO_DIR}/**.po") | 28 | file(GLOB_RECURSE pofiles RELATIVE "${PO_DIR}" "${PO_DIR}/**.po") | ||
29 | 29 | | |||
30 | include(ProcessorCount) | 30 | include(ProcessorCount) | ||
31 | ProcessorCount(numberOfProcesses) | 31 | ProcessorCount(numberOfProcesses) | ||
anthonyfieroni: you can downgrade by 1 numberOfProcesses, BTW it's best value to have *alive* system.
PS… | |||||
32 | 32 | | |||
33 | set(i 0) | 33 | set(i 0) | ||
34 | set(commands) | 34 | set(commands "") | ||
35 | 35 | | |||
36 | function(_processCommands) | 36 | function(_processCommands) | ||
37 | if(NOT commands) | 37 | if(NOT commands) | ||
38 | return() | 38 | return() | ||
39 | endif() | 39 | endif() | ||
40 | 40 | | |||
41 | execute_process( | 41 | execute_process( | ||
42 | ${commands} | 42 | ${commands} | ||
Show All 14 Lines | 50 | foreach(pofile IN LISTS pofiles) | |||
57 | set(dest ${COPY_TO}/${langdir}/LC_MESSAGES) | 57 | set(dest ${COPY_TO}/${langdir}/LC_MESSAGES) | ||
58 | file(MAKE_DIRECTORY ${dest}) | 58 | file(MAKE_DIRECTORY ${dest}) | ||
59 | 59 | | |||
60 | list(APPEND commands COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${dest}/${name}.mo ${PO_DIR}/${pofile}) | 60 | list(APPEND commands COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${dest}/${name}.mo ${PO_DIR}/${pofile}) | ||
61 | math(EXPR i "${i}+1") | 61 | math(EXPR i "${i}+1") | ||
62 | if(i EQUAL ${numberOfProcesses}) | 62 | if(i EQUAL ${numberOfProcesses}) | ||
63 | _processCommands() | 63 | _processCommands() | ||
64 | set(i 0) | 64 | set(i 0) | ||
65 | set(commands "") | ||||
tcberner: ^ this is probalby the only required change. | |||||
65 | endif() | 66 | endif() | ||
66 | endforeach() | 67 | endforeach() | ||
67 | 68 | | |||
68 | _processCommands() | 69 | _processCommands() |
you can downgrade by 1 numberOfProcesses, BTW it's best value to have *alive* system.
PS: Probably you should check -1 if it's > 1