mirror of
https://github.com/curl/curl.git
synced 2026-07-24 16:47:16 +03:00
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:
parent
625f2c1644
commit
304b01b8cf
3 changed files with 10 additions and 9 deletions
|
|
@ -77,6 +77,13 @@ if(BUILD_STATIC_CURL)
|
|||
set(CURLX_CFILES ${CURLTOOL_LIBCURL_CFILES})
|
||||
endif()
|
||||
|
||||
set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
|
||||
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
|
||||
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
|
||||
# This is needed as tool_hugehelp.c is generated in the binary dir
|
||||
"${PROJECT_SOURCE_DIR}/src" # for "tool_hugehelp.h"
|
||||
)
|
||||
|
||||
add_executable(
|
||||
${EXE_NAME}
|
||||
${CURL_CFILES} ${_curl_cfiles_gen} ${CURLX_CFILES} ${CURL_HFILES} ${_curl_hfiles_gen}
|
||||
|
|
@ -109,13 +116,6 @@ source_group("curlX source files" FILES ${CURLX_CFILES})
|
|||
source_group("curl source files" FILES ${CURL_CFILES} ${_curl_cfiles_gen})
|
||||
source_group("curl header files" FILES ${CURL_HFILES} ${_curl_hfiles_gen})
|
||||
|
||||
include_directories(
|
||||
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
|
||||
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
|
||||
# This is needed as tool_hugehelp.c is generated in the binary dir
|
||||
"${PROJECT_SOURCE_DIR}/src" # for "tool_hugehelp.h"
|
||||
)
|
||||
|
||||
# Build curl executable
|
||||
target_link_libraries(${EXE_NAME} ${LIB_SELECTED_FOR_EXE} ${CURL_LIBS})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue