File: FindMake.cmake

package info (click to toggle)
ceph 18.2.7%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,186,140 kB
  • sloc: cpp: 6,278,388; ansic: 3,507,431; python: 372,964; asm: 216,381; java: 133,450; sh: 125,043; xml: 39,398; ruby: 32,026; makefile: 29,004; javascript: 23,994; cs: 18,980; perl: 9,708; sql: 7,833; lisp: 5,920; pascal: 3,109; ada: 1,681; yacc: 478; awk: 188; f90: 55; php: 1
file content (17 lines) | stat: -rw-r--r-- 717 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()