Imported Debian patch 1.4+222+hg5f9f7194267b-1~trusty
[deb_x265.git] / source / cmake / FindYasm.cmake
CommitLineData
72b9787e
JB
1include(FindPackageHandleStandardArgs)
2
3# Simple path search with YASM_ROOT environment variable override
4find_program(YASM_EXECUTABLE
5 NAMES yasm yasm-1.2.0-win32 yasm-1.2.0-win64
6 HINTS $ENV{YASM_ROOT} ${YASM_ROOT}
7 PATH_SUFFIXES bin
8)
9
10if(YASM_EXECUTABLE)
11 execute_process(COMMAND ${YASM_EXECUTABLE} --version
12 OUTPUT_VARIABLE yasm_version
13 ERROR_QUIET
14 OUTPUT_STRIP_TRAILING_WHITESPACE
15 )
16 if(yasm_version MATCHES "^yasm ([0-9\\.]*)")
17 set(YASM_VERSION_STRING "${CMAKE_MATCH_1}")
18 endif()
19 unset(yasm_version)
20endif()
21
22# Provide standardized success/failure messages
23find_package_handle_standard_args(yasm
24 REQUIRED_VARS YASM_EXECUTABLE
25 VERSION_VAR YASM_VERSION_STRING)