we cannot assume that we are using `make` as the cmake generatator,
for instance, if ninja is used, `$(MAKE)` won't be substituted by ninja.
so we need to check if Make is used as generator, if that's the case, we
can just use `$(MAKE)` so we can benefit from the job control of `make`,
otherwise, `make` is used, because currently, PMDK uses Makefile to
build.
Signed-off-by: Kefu Chai <kchai@redhat.com>
endif()
set(PMDK_LIB "${PMDK_SRC}/${PMDK_LIB_DIR}")
+ include(FindMake)
+ find_make("MAKE_EXECUTABLE" "make_cmd")
+
ExternalProject_Add(pmdk_ext
GIT_REPOSITORY "https://github.com/ceph/pmdk.git"
GIT_TAG "1.7"
# build system tests statically linking to librbd (which uses
# libpmemobj) will not link (because we don't build the ndctl
# static library here).
- BUILD_COMMAND $(MAKE) NDCTL_ENABLE=n
+ BUILD_COMMAND ${make_cmd} NDCTL_ENABLE=n
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS "${PMDK_LIB}/libpmem.a" "${PMDK_LIB}/libpmemobj.a"
INSTALL_COMMAND "true")