mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-01 06:49:56 +08:00
b7a1088ae9
* [yasm/yasm-tool] Incorporate yasm-tool into yasm * version * Fix merge issue * version * Add missing dependency feature * version * Apply suggestions * version
28 lines
859 B
CMake
28 lines
859 B
CMake
set(Z_YASM_TOOL_HELPER_LIST_DIR "${CMAKE_CURRENT_LIST_DIR}")
|
|
|
|
function(yasm_tool_helper)
|
|
cmake_parse_arguments(PARSE_ARGV 0 arg
|
|
"APPEND_TO_PATH;PREPEND_TO_PATH"
|
|
"OUT_VAR"
|
|
""
|
|
)
|
|
|
|
if(DEFINED arg_UNPARSED_ARGUMENTS)
|
|
message(FATAL_ERROR "Unexpected arguments to yasm_tool_helper: ${arg_UNPARSED_ARGUMENTS}")
|
|
endif()
|
|
|
|
find_program(YASM yasm PATHS "${Z_YASM_TOOL_HELPER_LIST_DIR}/../../tools/yasm")
|
|
|
|
if(arg_APPEND_TO_PATH)
|
|
get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
|
|
vcpkg_add_to_path("${YASM_EXE_PATH}")
|
|
endif()
|
|
if(arg_PREPEND_TO_PATH)
|
|
get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
|
|
vcpkg_add_to_path(PREPEND "${YASM_EXE_PATH}")
|
|
endif()
|
|
if(DEFINED arg_OUT_VAR)
|
|
set("${arg_OUT_VAR}" "${YASM}" PARENT_SCOPE)
|
|
endif()
|
|
endfunction()
|