summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl
diff options
context:
space:
mode:
authorRaphael Kubo da Costa <rakuco@FreeBSD.org>2014-03-09 14:16:39 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-10 15:40:12 (GMT)
commite8c027bcc014eb2b84b663af9b79a5eefc437973 (patch)
tree48e6c3002835fe22737ef45444bb70ef6552ff12 /Utilities/cmcurl
parente21ffaf8fe5499426604b4ebb9cd08798ee6107c (diff)
downloadCMake-e8c027bcc014eb2b84b663af9b79a5eefc437973.zip
CMake-e8c027bcc014eb2b84b663af9b79a5eefc437973.tar.gz
CMake-e8c027bcc014eb2b84b663af9b79a5eefc437973.tar.bz2
cmcurl: Include the local curl directories before all others.
In some cases, it was possible for the include directory of the system-wide libcurl to be added to the include path before cmcurl's, which would result in them being picked up and causing the build to fail if the curl versions differ too much. One way to trigger this is to have OpenSSL installed into a non-default location together with libcurl (/usr/local, for example). If cmcurl is built with CMAKE_USE_OPENSSL on, -I/usr/local/include would end up being added before -I${PATH_TO_CMCURL}.
Diffstat (limited to 'Utilities/cmcurl')
-rw-r--r--Utilities/cmcurl/CMakeLists.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index abf04d8..1b918c9 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -172,6 +172,11 @@ IF(NOT CURL_SPECIAL_LIBZ)
CHECK_LIBRARY_EXISTS_CONCAT("z" inflateEnd HAVE_LIBZ)
ENDIF(NOT CURL_SPECIAL_LIBZ)
+# Include the local directories before any others so that we do not end up
+# including system curl's include directory first by mistake.
+INCLUDE_DIRECTORIES(${LIBCURL_SOURCE_DIR})
+INCLUDE_DIRECTORIES(${LIBCURL_BINARY_DIR})
+
OPTION(CMAKE_USE_OPENSSL "Use OpenSSL code with curl." OFF)
MARK_AS_ADVANCED(CMAKE_USE_OPENSSL)
IF(CMAKE_USE_OPENSSL)
@@ -679,8 +684,6 @@ INCLUDE(CMake/OtherTests.cmake)
# The rest of the build
-INCLUDE_DIRECTORIES(${LIBCURL_SOURCE_DIR})
-INCLUDE_DIRECTORIES(${LIBCURL_BINARY_DIR})
OPTION(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" TRUE)
IF(CMAKE_BUILD_CURL_SHARED)
SET(LIBRARY_TYPE SHARED)