Skip to content

Commit

Permalink
Fixed system include exports to external targets
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFlt committed Sep 17, 2024
1 parent a1cc310 commit aa5fb52
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmake/VISPGenerateConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ foreach(m ${VISP_MODULES_BUILD})
list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE "${VISP_MODULE_${m}_LOCATION}/include")
endif()
list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS})
list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_SYSTEM_INC_DEPS})

endforeach()
vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE)

Expand Down
11 changes: 10 additions & 1 deletion cmake/VISPModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,17 @@ macro(vp_target_include_modules target)
endif()
elseif(EXISTS "${d}")
# FS keep external deps inc
set(VISP_MODULE_${the_module}_INC_DEPS "${VISP_MODULE_${the_module}_INC_DEPS};${d}" CACHE INTERNAL "")
if(is_system)
set(VISP_MODULE_${the_module}_SYSTEM_INC_DEPS "${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS};${d}" CACHE INTERNAL "")
else()
set(VISP_MODULE_${the_module}_INC_DEPS "${VISP_MODULE_${the_module}_INC_DEPS};${d}" CACHE INTERNAL "")
endif()
vp_target_include_directories(${target} "${is_system}" "${d}")
endif()
endforeach()
vp_list_unique(VISP_MODULE_${the_module}_INC_DEPS)
vp_list_unique(VISP_MODULE_${the_module}_SYSTEM_INC_DEPS)

endmacro()

# setup include paths for the list of passed modules and recursively add dependent modules
Expand Down Expand Up @@ -834,6 +840,9 @@ macro(_vp_create_module)
set_property(TARGET ${the_module} APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_INC_DEPS}
)
set_property(TARGET ${the_module} APPEND PROPERTY
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS}
)

# For dynamic link numbering convenions
if(NOT ANDROID)
Expand Down
2 changes: 2 additions & 0 deletions cmake/VISPUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,8 @@ macro(vp_get_all_includes _includes_modules _includes_extra _system_include_dirs

foreach(m ${VISP_MODULES_BUILD})
list(APPEND ${_includes_extra} ${VISP_MODULE_${m}_INC_DEPS})
list(APPEND ${_system_include_dirs} ${VISP_MODULE_${m}_SYSTEM_INC_DEPS})

if(EXISTS "${VISP_MODULE_${m}_LOCATION}/include")
list(INSERT ${_includes_modules} 0 "${VISP_MODULE_${m}_LOCATION}/include")
endif()
Expand Down

0 comments on commit aa5fb52

Please sign in to comment.