# Internal: Recurse into target libraries and collect their include directories
# and macro definitions.
-macro(curl_collect_target_options _target)
- get_target_property(_val ${_target} COMPILE_DEFINITIONS)
+macro(curl_collect_target_compile_options _target)
+ get_target_property(_val ${_target} INTERFACE_COMPILE_DEFINITIONS)
if(_val)
list(APPEND _definitions ${_val})
endif()
- get_target_property(_val ${_target} INCLUDE_DIRECTORIES)
- if(_val)
- list(APPEND _includes ${_val})
- endif()
get_target_property(_val ${_target} INTERFACE_INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _incsys ${_val})
endif()
- get_target_property(_val ${_target} COMPILE_OPTIONS)
+ get_target_property(_val ${_target} INTERFACE_COMPILE_OPTIONS)
if(_val)
list(APPEND _options ${_val})
endif()
if(_val)
foreach(_lib IN LISTS _val)
if(TARGET "${_lib}")
- curl_collect_target_options(${_lib})
+ curl_collect_target_compile_options(${_lib})
endif()
endforeach()
endif()
endif()
endforeach()
- # Collect macro definitions and header directories applying to the directory
+ # Collect options applying to the directory
get_directory_property(_val COMPILE_DEFINITIONS)
if(_val)
list(APPEND _definitions ${_val})
if(_val)
list(APPEND _options ${_val})
endif()
- unset(_val)
+
+ # Collect options applying to the target
+ get_target_property(_val ${_target} COMPILE_DEFINITIONS)
+ if(_val)
+ list(APPEND _definitions ${_val})
+ endif()
+ get_target_property(_val ${_target} INCLUDE_DIRECTORIES)
+ if(_val)
+ list(APPEND _includes ${_val})
+ endif()
+ get_target_property(_val ${_target} COMPILE_OPTIONS)
+ if(_val)
+ list(APPEND _options ${_val})
+ endif()
# Collect header directories and macro definitions from lib dependencies
- curl_collect_target_options(${_target})
+ curl_collect_target_compile_options(${_target})
list(REMOVE_ITEM _definitions "")
string(REPLACE ";" ";-D" _definitions ";${_definitions}")