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

@ -190,7 +190,7 @@ else()
set(CURL_OS "\"${CMAKE_SYSTEM_NAME}\"")
endif()
include_directories("${PROJECT_SOURCE_DIR}/include")
set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES "${PROJECT_SOURCE_DIR}/include")
if(NOT DEFINED CMAKE_UNITY_BUILD_BATCH_SIZE)
set(CMAKE_UNITY_BUILD_BATCH_SIZE 0)