build: tidy up header paths, use srcdir where possible

To improve readability.

Also add more comments on why each is necessary.

Closes #17630
This commit is contained in:
Viktor Szakats 2025-06-14 17:06:58 +02:00
parent 548873921c
commit 8e47c8a764
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
13 changed files with 30 additions and 25 deletions

View file

@ -79,11 +79,10 @@ if(BUILD_STATIC_CURL)
endif()
set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
"${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx functions
# This is needed as tool_hugehelp.c is generated in the binary dir
"${PROJECT_SOURCE_DIR}/src" # for "tool_hugehelp.h"
"${CMAKE_CURRENT_SOURCE_DIR}" # for "tool_hugehelp.c"
)
add_executable(${EXE_NAME} ${CURL_CFILES} ${_curl_cfiles_gen} ${CURLX_CFILES} ${CURL_HFILES} ${_curl_hfiles_gen})

View file

@ -38,14 +38,14 @@ EXTRA_DIST = mk-file-embed.pl mkhelp.pl \
# $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
# $(top_builddir)/src is for curl's generated src/curl_config.h file
# $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files
# $(top_srcdir)/src is for curl's src/tool_setup.h and "curl-private" files
# $(srcdir) for generated sources to find included sources
AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_builddir)/lib \
-I$(top_builddir)/src \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib/curlx \
-I$(top_srcdir)/src
-I$(srcdir)
bin_PROGRAMS = curl