cmake find_program examples

Signatures

find_program (
  <VAR>
  name | NAMES name1 [name2 ...] [NAMES_PER_DIR]
  [HINTS [path | ENV var]...]
  [PATHS [path | ENV var]...]
  [REGISTRY_VIEW (64|32|64_32|32_64|HOST|TARGET|BOTH)]
  [PATH_SUFFIXES suffix1 [suffix2 ...]]
  [VALIDATOR function]
  [DOC "cache documentation string"]
  [NO_CACHE]
  [REQUIRED|OPTIONAL]
  [NO_DEFAULT_PATH]
  [NO_PACKAGE_ROOT_PATH]
  [NO_CMAKE_PATH]
  [NO_CMAKE_ENVIRONMENT_PATH]
  [NO_SYSTEM_ENVIRONMENT_PATH]
  [NO_CMAKE_SYSTEM_PATH]
  [NO_CMAKE_INSTALL_PREFIX]
  [CMAKE_FIND_ROOT_PATH_BOTH |
  ONLY_CMAKE_FIND_ROOT_PATH |
  NO_CMAKE_FIND_ROOT_PATH]
)

Examples

prusa3d/PrusaSlicer cmake/modules/FindwxWidgets.cmake :897

find_program(_cygpath_exe cygpath ONLY_CMAKE_FIND_ROOT_PATH)

mariadb-corporation/MaxScale cmake/FindGSSAPI.cmake :42

find_program(KRB5_CONFIG NAMES krb5-config heimdal-krb5-config PATHS
     /opt/local/bin
     /usr/lib/mit/bin # For OpenSUSE Leap
     ONLY_CMAKE_FIND_ROOT_PATH               # this is required when cross compiling with cmake 2.6 and ignored with cmake 2.4, Alex
  )

gnss-sdr/gnss-sdr cmake/Modules/FindGNSSSIMULATOR.cmake :27

find_program(SW_GENERATOR_BIN gnss_sim
    PATHS
        ${GNSSSIMULATOR_ROOT_USER_DEFINED}
        /usr
        /usr/local
        ${CMAKE_SYSTEM_PREFIX_PATH}
        ${CMAKE_INSTALL_FULL_BINDIR}
    PATH_SUFFIXES bin
    ONLY_CMAKE_FIND_ROOT_PATH
)

KiCad/kicad-source-mirror cmake/FindwxWidgets.cmake :766

find_program(wxWidgets_CONFIG_EXECUTABLE
      NAMES wx-config wx-config-3.1 wx-config-3.0 wx-config-2.9 wx-config-2.8
      DOC "Location of wxWidgets library configuration provider binary (wx-config)."
      ONLY_CMAKE_FIND_ROOT_PATH
      )

BelledonneCommunications/liblinphone tester/CMakeLists.txt :461

find_program(SIPP_PROGRAM NAMES sipp sipp.exe ONLY_CMAKE_FIND_ROOT_PATH)

arkdb/arkproxy plugin/auth_gssapi/cmake/FindGSSAPI.cmake :42

find_program(KRB5_CONFIG NAMES krb5-config heimdal-krb5-config PATHS
     /opt/local/bin
     ONLY_CMAKE_FIND_ROOT_PATH               # this is required when cross compiling with cmake 2.6 and ignored with cmake 2.4, Alex
  )