Jobserver is not available when creating external projects using CMake

I am trying to create some external projects using CMake on linux using ExternalProject_add. However, they do not comply with the command make -j12and issue a warning:

‘warning: jobserver unavailable: using -j1. Add `+' to parent make rule.’

It slows down my work hurt. Is there a way to build external projects in parallel? Here is an example project:

include(ExternalProject)
    ExternalProject_Add(
        ${TARGET_NAME}-ext
        URL ${CMAKE_CURRENT_SOURCE_DIR}/xerces-c-${VERSION_XERCESC}.tar.gz
        DOWNLOAD_DIR ${XERCESC_DIR}
        SOURCE_DIR ${XERCESC_DIR}/src
        PATCH_COMMAND chmod guo+rw ${CMAKE_CURRENT_SOURCE_DIR} -R
        CONFIGURE_COMMAND ./configure --prefix=${XERCESC_DIR} --disable-shared -q --disable-network --enable-transcoder-gnuiconv --enable-msgloader-inmemory
        BUILD_COMMAND make --silent
        INSTALL_COMMAND make install
        BUILD_IN_SOURCE 1
    )
+4
source share
1 answer

In order for the commands to makecorrectly apply to your children, you need to use $(MAKE)parentheses (not curly braces) instead of make as your command, i.e.

BUILD_COMMAND $(MAKE) --silent
INSTALL_COMMAND $(MAKE) install

This is supported by CMake version 2.8.4.

+9
source

Source: https://habr.com/ru/post/1611948/


All Articles