diff --git a/CMakeLists.txt b/CMakeLists.txt index 7edaf518b8..a0ab0b184f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 8369138833..3e87198960 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a0b700bce4..3bf66091e3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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})