Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

idlcxx: add cmake argument to search additional include directories #191

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/idlcxx/Generate.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
function(IDLCXX_GENERATE)
set(one_value_keywords TARGET)
set(multi_value_keywords FILES FEATURES)
set(multi_value_keywords FILES FEATURES INCLUDES)
cmake_parse_arguments(
IDLCXX "" "${one_value_keywords}" "${multi_value_keywords}" "" ${ARGN})

Expand Down Expand Up @@ -42,6 +42,13 @@ function(IDLCXX_GENERATE)
list(APPEND IDLCXX_ARGS "-f" ${_feature})
endforeach()

# add directories to include search list
if(IDLCXX_INCLUDES)
foreach(_dir ${IDLCXX_INCLUDES})
list(APPEND IDLCXX_INCLUDE_DIRS "-I" ${_dir})
endforeach()
endif()

set(_dir ${CMAKE_CURRENT_BINARY_DIR})
set(_target ${IDLCXX_TARGET})
foreach(_file ${IDLCXX_FILES})
Expand All @@ -56,7 +63,7 @@ function(IDLCXX_GENERATE)
add_custom_command(
OUTPUT "${_header}"
COMMAND CycloneDDS::idlc
ARGS -l $<TARGET_FILE:CycloneDDS-CXX::idlcxx> ${IDLCXX_ARGS} ${_file}
ARGS -l $<TARGET_FILE:CycloneDDS-CXX::idlcxx> ${IDLCXX_ARGS} ${IDLCXX_INCLUDE_DIRS} ${_file}
DEPENDS ${_files} CycloneDDS::idlc CycloneDDS-CXX::idlcxx)
endforeach()

Expand Down