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=$/../../lib" $ ${_language} ${IDLC_ARGS} ${IDLC_INCLUDE_DIRS} ${_file} + DEPENDS ${_files} ${_depends}) + endif() endforeach() add_custom_target("${_target}_generate" DEPENDS "${_outputs}")