Commit | Line | Data |
---|---|---|
72b9787e JB |
1 | include(FindPackageHandleStandardArgs) |
2 | ||
3 | # Simple path search with YASM_ROOT environment variable override | |
4 | find_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 | ||
10 | if(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) | |
20 | endif() | |
21 | ||
22 | # Provide standardized success/failure messages | |
23 | find_package_handle_standard_args(yasm | |
24 | REQUIRED_VARS YASM_EXECUTABLE | |
25 | VERSION_VAR YASM_VERSION_STRING) |