vcpkg/ports/cyclonedds/idlc-generate.patch
2023-03-06 14:45:44 -08:00

30 lines
1.1 KiB
Diff

diff --git a/cmake/Modules/Generate.cmake b/cmake/Modules/Generate.cmake
index 0ed67d63..c22d9146 100644
--- a/cmake/Modules/Generate.cmake
+++ b/cmake/Modules/Generate.cmake
@@ -157,11 +157,19 @@ function(IDLC_GENERATE_GENERIC)
endforeach()
list(APPEND _outputs ${_file_outputs})
- add_custom_command(
- OUTPUT ${_file_outputs}
- COMMAND ${_idlc_executable}
- ARGS ${_language} ${IDLC_ARGS} ${IDLC_INCLUDE_DIRS} ${_file}
- DEPENDS ${_files} ${_depends})
+ if(NOT APPLE)
+ add_custom_command(
+ OUTPUT ${_file_outputs}
+ COMMAND ${_idlc_executable}
+ ARGS ${_language} ${IDLC_ARGS} ${IDLC_INCLUDE_DIRS} ${_file}
+ DEPENDS ${_files} ${_depends})
+ else()
+ add_custom_command(
+ OUTPUT ${_file_outputs}
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E env "DYLD_LIBRARY_PATH=$<TARGET_FILE_DIR:${_idlc_executable}>/../../lib" $<TARGET_FILE:${_idlc_executable}> ${_language} ${IDLC_ARGS} ${IDLC_INCLUDE_DIRS} ${_file}
+ DEPENDS ${_files} ${_depends})
+ endif()
endforeach()
add_custom_target("${_target}_generate" DEPENDS "${_outputs}")