vcpkg/ports/yasm-tool/vcpkg-port-config.cmake.in
nicole mazzuca 49b67d9cb8
[yasm-tool] Migrate to Host Dependencies (#16478)
* [yasm-tool] Fix usage of port to be host dependencies

This allows mpg123, nettle, and gmp to support non-x86 windows manifest mode

* fix gmp

* oops

* versions update
2021-05-21 11:56:32 -07:00

32 lines
949 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()
if(@YASM_BUILD_BINARY@)
set(YASM "${Z_YASM_TOOL_HELPER_LIST_DIR}/../../tools/yasm-tool/yasm.exe")
else()
vcpkg_find_acquire_program(YASM)
endif()
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()