]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/yasm-tool-helper/yasm-tool-helper.cmake
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / yasm-tool-helper / yasm-tool-helper.cmake
1 function(yasm_tool_helper)
2 cmake_parse_arguments(PARSE_ARGV 0 a
3 "APPEND_TO_PATH;PREPEND_TO_PATH"
4 "OUT_VAR"
5 ""
6 )
7
8 if(CMAKE_HOST_WIN32)
9 if(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP)
10 # Native compilation
11 set(YASM "${CURRENT_INSTALLED_DIR}/tools/yasm-tool/yasm.exe")
12 else()
13 # Cross compilation
14 get_filename_component(YASM "${CURRENT_INSTALLED_DIR}/../x86-windows/tools/yasm-tool/yasm.exe" ABSOLUTE)
15 if(NOT EXISTS "${YASM}")
16 message(FATAL_ERROR "Cross-targetting and x64 ports requiring yasm require the x86-windows yasm-tool to be available. Please install yasm-tool:x86-windows first.")
17 endif()
18 endif()
19 else()
20 vcpkg_find_acquire_program(YASM)
21 endif()
22
23 if(a_APPEND_TO_PATH)
24 get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
25 vcpkg_add_to_path("${YASM_EXE_PATH}")
26 endif()
27 if(a_PREPEND_TO_PATH)
28 get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
29 vcpkg_add_to_path(PREPEND "${YASM_EXE_PATH}")
30 endif()
31 if(a_OUT_VAR)
32 set(${a_OUT_VAR} "${YASM}" PARENT_SCOPE)
33 endif()
34 endfunction()