mirror of
https://github.com/ceph/ceph
synced 2024-12-12 14:39:05 +00:00
8f7fae7a78
it's a shorthand for finding "make" or "gmake" (for FreeBSD), and set the path to the executable and the command to use in the generated "Makefile" or whatever build script generated by cmake. Signed-off-by: Kefu Chai <kchai@redhat.com>
18 lines
717 B
CMake
18 lines
717 B
CMake
function(find_make make_exe make_cmd)
|
|
# make_exe the name of the variable whose value will be the path to "make"
|
|
# executable
|
|
# make_cmd the name of the variable whose value will be the command to
|
|
# used in the generated build script executed by the cmake generator
|
|
find_program(MAKE_EXECUTABLE NAMES gmake make)
|
|
if(NOT MAKE_EXECUTABLE)
|
|
message(FATAL_ERROR "Can't find make")
|
|
endif()
|
|
set(${make_exe} "${MAKE_EXECUTABLE}" PARENT_SCOPE)
|
|
if(CMAKE_MAKE_PROGRAM MATCHES "make")
|
|
# try to inherit command line arguments passed by parent "make" job
|
|
set(${make_cmd} "$(MAKE)" PARENT_SCOPE)
|
|
else()
|
|
set(${make_cmd} "${MAKE_EXECUTABLE}" PARENT_SCOPE)
|
|
endif()
|
|
endfunction()
|