cmake: use INCLUDE_DIRECTORIES prop to specify local header dirs

To use more modern cmake, and make it somewhat more obvious where these
header directories should apply.

Also move setting the directory property _before_ defining targets,
to make them inherit this directory property.

Ref: https://cmake.org/cmake/help/latest/command/include_directories.html
Ref: https://cmake.org/cmake/help/latest/prop_dir/INCLUDE_DIRECTORIES.html

Follow-up to 45f7cb7695 #16238

Closes #16993
This commit is contained in:
Viktor Szakats 2025-04-08 11:01:09 +02:00
parent 625f2c1644
commit 304b01b8cf
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
3 changed files with 10 additions and 9 deletions

View file

@ -36,7 +36,8 @@ list(APPEND HHEADERS "${CMAKE_CURRENT_BINARY_DIR}/curl_config.h")
# The rest of the build
include_directories("${PROJECT_BINARY_DIR}/lib") # for "curl_config.h"
set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES "${PROJECT_BINARY_DIR}/lib") # for "curl_config.h"
if(USE_ARES)
include_directories(SYSTEM ${CARES_INCLUDE_DIRS})
endif()