jobserver unavailable when building external projects with CMake

Nicolas Holthaus

I'm trying to build some external projects with CMake on linux using ExternalProject_add. However, they aren't respecting the make -j12 command, and are giving the warning:

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

This slows my build painfully. Is there some way to build external projects in parallel? Here's 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
    )
Nicolas Holthaus

In order to allow the make commands to properly propagate to their children, you need to use $(MAKE) with parenthesis (not curly-braces) instead of make as your command, i.e.

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

This is supported from CMake version 2.8.4 onward.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Cmake building two projects

From Dev

Using cmake for a project with sub/external projects/dependencies

From Dev

Errors when building a library with CMake

From Dev

qtcreator ignores cmake options when building with cmake

From Dev

Run lint when building android studio projects

From Dev

NullPointerException when building Liferay projects with Maven

From Dev

Run lint when building android studio projects

From Dev

React Js Error when building projects

From Dev

How to tell CMake to download external projects before compiling my sources

From Dev

cmake external projects command seems to ignore INSTALL_DIR

From Dev

Building SDL2_image as a CMake external project

From Dev

Force building external project (with buildtools) before main project with CMake

From Dev

CMake error when building OpenCV - CMakeLists not match

From Dev

CMake fails when building OpenCV (Ubuntu)

From Java

How to avoid reinstalling packages when building Docker image for Python projects?

From Java

BuildConfig.DEBUG always false when building library projects with gradle

From Dev

android/log.h not found when building with cmake

From Dev

Linking error when building OpenCV 3.0 with CMake and NMake

From Dev

Why is CMake ignoring assembly files when building static library?

From Dev

Use a non-default libstdc++ when building CMake?

From Dev

Why is CMake ignoring assembly files when building static library?

From Dev

Understanding CMAKE_INSTALL_PREFIX when building LLVM

From Dev

CMake: Executing a C++ file when building the project

From Dev

Cmake Error when building glew 2.0.0 with MinGW 4.9.2

From Dev

Dealing with decorated external binaries when building a package with Rcpp

From Dev

VisualStudio 2017 runs .exe when building on external console

From Dev

Building XCode projects with Jenkins

From Dev

CMake Nested Projects and Targets

From Dev

Issue with CMake project building

Related Related

  1. 1

    Cmake building two projects

  2. 2

    Using cmake for a project with sub/external projects/dependencies

  3. 3

    Errors when building a library with CMake

  4. 4

    qtcreator ignores cmake options when building with cmake

  5. 5

    Run lint when building android studio projects

  6. 6

    NullPointerException when building Liferay projects with Maven

  7. 7

    Run lint when building android studio projects

  8. 8

    React Js Error when building projects

  9. 9

    How to tell CMake to download external projects before compiling my sources

  10. 10

    cmake external projects command seems to ignore INSTALL_DIR

  11. 11

    Building SDL2_image as a CMake external project

  12. 12

    Force building external project (with buildtools) before main project with CMake

  13. 13

    CMake error when building OpenCV - CMakeLists not match

  14. 14

    CMake fails when building OpenCV (Ubuntu)

  15. 15

    How to avoid reinstalling packages when building Docker image for Python projects?

  16. 16

    BuildConfig.DEBUG always false when building library projects with gradle

  17. 17

    android/log.h not found when building with cmake

  18. 18

    Linking error when building OpenCV 3.0 with CMake and NMake

  19. 19

    Why is CMake ignoring assembly files when building static library?

  20. 20

    Use a non-default libstdc++ when building CMake?

  21. 21

    Why is CMake ignoring assembly files when building static library?

  22. 22

    Understanding CMAKE_INSTALL_PREFIX when building LLVM

  23. 23

    CMake: Executing a C++ file when building the project

  24. 24

    Cmake Error when building glew 2.0.0 with MinGW 4.9.2

  25. 25

    Dealing with decorated external binaries when building a package with Rcpp

  26. 26

    VisualStudio 2017 runs .exe when building on external console

  27. 27

    Building XCode projects with Jenkins

  28. 28

    CMake Nested Projects and Targets

  29. 29

    Issue with CMake project building

HotTag

Archive