summaryrefslogtreecommitdiff
path: root/CMake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: fix typos and spellingDaniel Gustafsson2019-07-092-3/+3
|
* CMake: Convert errant elseif() to else()Kyle Edwards2019-07-091-1/+1
| | | | | | | | | | | CMake interprets an elseif() with no arguments as elseif(FALSE), resulting in the elseif() block not being executed. That is not what was intended here. Change the empty elseif() to an else() as it was intended. Closes #4101 Reported-by: Artalus <artalus-mail@yandex.ru> Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
* build: fix Codacy warningsMarcel Raad2019-06-051-0/+2
| | | | | | Reduce variable scopes and remove redundant variable stores. Closes https://github.com/curl/curl/pull/3975
* cmake: restore C89 compatibility of CurlTests.cMarcel Raad2019-05-121-2/+2
| | | | | | | | | I broke it in d1b5cf830bfe169745721b21245d2217d2c2453e and 97de97daefc2ed084c91eff34af2426f2e55e134. Reported-by: Viktor Szakats Ref: https://github.com/curl/curl/commit/97de97daefc2ed084c91eff34af2426f2e55e134#commitcomment-33499044 Closes https://github.com/curl/curl/pull/3868
* CMake: suppress unused variable warningsMarcel Raad2019-05-111-0/+2
| | | | I missed these in commit d1b5cf830bfe169745721b21245d2217d2c2453e.
* build: fix Codacy/CppCheck warningsMarcel Raad2019-04-111-0/+4
| | | | | | | | | | - remove unused variables - declare conditionally used variables conditionally - suppress unused variable warnings in the CMake tests - remove dead variable stores - consistently use WIN32 macro to detect Windows Closes https://github.com/curl/curl/pull/3739
* cmake: avoid linking executable for some tests with cmake 3.6+Jakub Zakrzewski2019-04-101-35/+40
| | | | | | | | | | | | With CMAKE_TRY_COMPILE_TARGET_TYPE set to STATIC_LIBRARY, the try_compile() (which is used by check_c_source_compiles()) will build static library instead of executable. This avoids linking additional libraries in and thus speeds up those checks a little. This commit also avoids #3743 (GSSAPI build errors) on itself with cmake 3.6 or above. That issue was fixed separately for all versions. Ref: #3744
* cmake: updated check for HAVE_POLL_FINE to match autotoolsSergei Nikulov2019-01-161-7/+35
|
* cmake: added checks for HAVE_VARIADIC_MACROS_C99 and HAVE_VARIADIC_MACROS_GCCSergei Nikulov2019-01-111-2/+44
|
* CMake: fix MIT/Heimdal Kerberos detectionKonstantin Kushnir2018-11-291-2/+2
| | | | | | | | - fix syntax error in FindGSS.cmake - correct krb5 include directory. FindGSS exports "GSS_INCLUDE_DIR" variable. Closes https://github.com/curl/curl/pull/3316
* cmake: uniform ZLIB to use USE_ variable and clean curl-config.cmake.inTuomo Rinne2018-10-291-9/+6
| | | | Closes #3123
* cmake: add find_dependency call for ZLIB to CMake config fileTuomo Rinne2018-10-291-2/+8
|
* cmake: test and set missed defines during configurationdmitrykos2018-10-051-0/+16
| | | | | | Added configuration checks for HAVE_BUILTIN_AVAILABLE and HAVE_CLOCK_GETTIME_MONOTONIC. Closes #3097
* CMake: Improve config installationRuslan Baratov2018-10-011-58/+3
| | | | | | | | | | | | | | | | | | | | | | Use 'GNUInstallDirs' standard module to set destinations of installed files. Use uppercase "CURL" names instead of lowercase "curl" to match standard 'FindCURL.cmake' CMake module: * https://cmake.org/cmake/help/latest/module/FindCURL.html Meaning: * Install 'CURLConfig.cmake' instead of 'curl-config.cmake' * User should call 'find_package(CURL)' instead of 'find_package(curl)' Use 'configure_package_config_file' function to generate 'CURLConfig.cmake' file. This will make 'curl-config.cmake.in' template file smaller and handle components better. E.g. current configuration report no error if user specified unknown components (note: new configuration expects no components, report error if user will try to specify any). Closes https://github.com/curl/curl/pull/2849
* whitespace fixesViktor Szakats2018-09-231-1/+0
| | | | | | | | | | | - replace tabs with spaces where possible - remove line ending spaces - remove double/triple newlines at EOF - fix a non-UTF-8 character - cleanup a few indentations/line continuations in manual examples Closes https://github.com/curl/curl/pull/3037
* cmake: don't require OpenSSL if USE_OPENSSL=OFFslodki2018-09-181-2/+2
| | | | | | | | | User must have OpenSSL installed even if not used by libcurl at all since 7.61.1 release. Broken at 7867aaa9a01decf93711428462335be8cef70212 Reviewed-by: Sergei Nikulov Closes #3001
* cmake: link curl to the OpenSSL targets instead of lib absolute pathsJohn Butterfield2018-08-081-0/+5
| | | | | | Reviewed-by: Jakub Zakrzewski Reviewed-by: Sergei Nikulov Closes #2753
* CMake: Update scripts to use consistent styleRuslan Baratov2018-07-178-369/+329
| | | | | Closes #2727 Reviewed-by: Sergei Nikulov
* CMake: remove redundant and old end-of-block syntaxRuslan Baratov2018-07-093-49/+47
| | | | | Reviewed-by: Jakub Zakrzewski Closes #2715
* CMake: Remove unused 'output_var' from 'collect_true'Ruslan Baratov2018-07-061-6/+5
| | | | | Variable 'output_var' is not used and can be removed. Function 'collect_true' renamed to 'count_true'.
* CMake: Remove unused functionsRuslan Baratov2018-07-061-30/+0
| | | | Closes #2711
* cmake: fixed comments in compile checks codeSergei Nikulov2018-05-291-3/+3
|
* Fix the test for fsetxattr and strerror_r tests in CMake to work without ↵maxed2018-05-281-15/+15
| | | | compiling
* cmake: add support for brotliDon2018-03-191-0/+20
| | | | | | | | Currently CMake cannot detect Brotli support. This adds detection of the libraries and associated header files. It also adds this to the generated config. Closes #2392
* spelling fixesViktor Szakats2018-02-231-1/+1
| | | | | | | | Detected using the `codespell` tool. Also contains one URL protocol upgrade. Closes https://github.com/curl/curl/pull/2334
* cmake: Export libcurl and curl targets to use by other cmake projectsJakub Zakrzewski2017-10-281-0/+59
| | | | | | | | | The config files define curl and libcurl targets as imported targets CURL::curl and CURL::libcurl. For backward compatibility with CMake- provided find-module the CURL_INCLUDE_DIRS and CURL_LIBRARIES are also set. Closes #1879
* cmake: disable tests and man generation if perl/nroff not foundSergei Nikulov2017-10-021-0/+29
| | | | | | | | | | | | Fixes https://github.com/curl/curl/issues/1500 Reported-by: Jay Satiro Fixes https://github.com/curl/curl/pull/1662 Assisted-by: Tom Seddon Assisted-by: dpull@users.noreply.github.com Assisted-by: elelel@users.noreply.github.com Closes https://github.com/curl/curl/pull/1924
* cmake: move cmake_uninstall.cmake to CMake/Daniel Stenberg2017-08-101-0/+26
| | | | Closes #1756
* cmake: fix send/recv argument scanner for windowsDaniel Stenberg2017-07-051-6/+6
| | | | | | ... by simply trying the Windows argument types first. Fixes #1640
* spelling fixesklemens2017-03-261-1/+1
| | | | Closes #1356
* CMake: Set at most one SSL libraryMichael Maltese2017-03-051-0/+13
| | | | Ref: https://github.com/curl/curl/pull/1228
* CMake: Add mbedTLS supportMichael Maltese2017-03-051-0/+13
| | | | Ref: https://github.com/curl/curl/pull/1228
* cmake: Support curl --xattr when built with cmakeSean Burford2017-02-011-0/+16
| | | | | | | - Test for and set HAVE_FSETXATTR when support for extended file attributes is present. Closes https://github.com/curl/curl/pull/1176
* cmake: disable poll for macOSPeter Wu2016-11-061-11/+14
| | | | | | Mirrors the autotools behavior introduced with curl-7_50_3-83-ga34c7ce. Fixes #1089
* cmake: add nghttp2 supportRemo E2016-10-101-0/+18
| | | | Closes #922
* CMake: Try to (un-)hide private library symbolsJakub Zakrzewski2016-09-101-0/+61
| | | | | | | | | | Detect support for compiler symbol visibility flags and apply those according to CURL_HIDDEN_SYMBOLS option. It should work true to the autotools build except it tries to unhide symbols on Windows when requested and prints warning if it fails. Ref: https://github.com/curl/curl/issues/981#issuecomment-242665951 Reported-by: Daniel Stenberg
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* CMake: Put "winsock2.h" before "windows.h" during configure checksJakub Zakrzewski2015-09-231-1/+1
| | | | | "windows.h" includes "winsock.h" what causes many redefinition errors if "winsock2.h" is included afterwards and can cause build to fail.
* cmake: Fix CurlTests check for gethostbyname_r with 5 argumentsBrad King2015-08-141-1/+1
| | | | | | Fix the check code to pass 5 arguments instead of 6. This typo was introduced by commit aebfd4cfbf (cmake: fix gethostby{addr,name}_r in CurlTests, 2014-10-31).
* CMake: fix winsock2 detection on windowsSergei Nikulov2015-02-191-1/+1
| | | | | | | | | | | | | | Set CMAKE_REQUIRED_DEFINITIONS to include definitions needed to get the winsock2 API from windows.h. Simplify the order of checks to avoid extra conditions. Use check_include_file instead of check_include_file_concat to look for OpenSSL headers. They do not need to participate in a sequence of dependent system headers. Also they may cause winsock.h to be included before ws2tcpip.h, causing the latter to not be detected in the sequence. Reviewed-by: Brad King <brad.king@kitware.com>
* CMake: Simplify if() conditions on check result variablesBrad King2014-11-191-4/+4
| | | | | | | | | | | Remove use of an old hack that takes advantage of the auto-dereference behavior of the if() command to detect if a variable is defined. The hack has the form: if("${VAR} MATCHES "^${VAR}$") where "${VAR}" is a macro argument reference. Use if(DEFINED) instead. This also avoids warnings for CMake Policy CMP0054 in CMake 3.1.
* CMake: Restore order-dependent library checksBrad King2014-11-131-3/+6
| | | | | | | | | | | | | Revert commit 2257deb502 (Cmake: Avoid cycle directory dependencies, 2014-08-22) and add a comment explaining the purpose of the original code. The check_library_exists_concat macro is intended to be called multiple times on a sequence of possibly dependent libraries. Later libraries may depend on earlier libraries when they are static. They cannot be safely linked in reverse order on some platforms. Signed-off-by: Brad King <brad.king@kitware.com>
* CMake: Restore order-dependent header checksBrad King2014-11-131-1/+4
| | | | | | | | | | | | | | | | | Revert commit 1269df2e3b (Cmake: Don't check for all headers each time, 2014-08-15) and add a comment explaining the purpose of the original code. The check_include_file_concat macro is intended to be called multiple times on a sequence of possibly dependent headers. Later headers may depend on earlier headers to provide declarations. They cannot be safely included independently on some platforms. For example, many POSIX APIs document including sys/types.h before some other headers. Also on some OS X versions sys/socket.h must be included before net/if.h or the check for the latter will fail. Signed-off-by: Brad King <brad.king@kitware.com>
* cmake: fix HAVE_GETHOSTNAME definitionPeter Wu2014-11-101-0/+1
| | | | | | | | | | | Otherwise Curl_gethostname always fails. Windows has gethostname since Vista according to http://msdn.microsoft.com/en-us/library/ms738527%28VS.85%29.aspx, but accordings to byte_bucket's VC 2005 documentation, it is available even in Windows 95. (possibly after installing a Platform SDK, the Windows Server 2003 SP1 Platform SDK should be sufficient). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* cmake: fix struct sockaddr_storage checkPeter Wu2014-11-031-23/+5
| | | | | | | | | | | | | | | CHECK_TYPE_SIZE_PREINCLUDE is an internal, undocumented variable which was removed in cmake 2.8.1. According to the MSDN docs[1], inclusion of winsock2.h is sufficient. WIN32_LEAN_AND_MEAN does not really seem to affect the tests, so remove it too[2]. For the non-windows case, remove inet headers as POSIX only requires sys/socket.h. [1]: http://msdn.microsoft.com/en-us/library/windows/desktop/ms740504%28v=vs.85%29.aspx [2]: http://stackoverflow.com/questions/11040133/what-does-defining-win32-lean-and-mean-exclude-exactly Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* cmake: clean OtherTests, fixing -WerrorPeter Wu2014-11-033-245/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were several -Wunused warnings and one duplicate macro definition. The EXTRA_DEFINES variable of the CurlCheckCSources macro was being abused ("__unused1\n#undef inline\n#define __unused2", seriously?) to insert extra C code. Avoid this broken abstraction and use cmake's check_c_source_compiles directly (works fine with CMake 2.8, maybe even cmake 2.6). After cleaning up all related variables (EXTRA_DEFINES, HEADER_INCLUDES, auxiliary headers_hack), also remove a duplicate add_headers_include macro and remove duplicate header additions before the struct timeval check. Oh, and now the code is converted to use CheckCSourceRuns and CheckCSourceCompiles, the two curl-specific helpers can be removed. Unfortunately, the cmake output is now slightly more verbose. Before: Performing Test int send(int, const void *, size_t, int) (curl_cv_func_send_test) Performing Test int send(int, const void *, size_t, int) (curl_cv_func_send_test) - Failed Since check_c_source_compiles prints the varname, now you see: Performing Test curl_cv_func_send_test Performing Test curl_cv_func_send_test - Failed Tested: int send(int, const void *, size_t, int) Compared cmake output with each other using vimdiff, no functional differences were found. Tested with GCC 4.9.1 and Clang 3.5.0. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* cmake: fix gethostby{addr,name}_r in CurlTestsPeter Wu2014-11-031-246/+70
| | | | | | | | | | | | | | | | | | | | | This patch cleans up the automatically-generated (?) code and fixes one case that will always fail due to syntax error. HAVE_GETHOSTBYADDR_R_5_REENTRANT always failed because of a trailing character ("int length;q"). Several parameter type and unused variable warnings popped up. This causes a detection failure with -Werror. Observe that the REENTRANT cases are exactly the same as their non-REENTRANT cases except for a `_REENTRANT` macro definition. Merge all these pieces and build one big main function with different cases, but reusing variables where logical. For the cases where the parameters where NULL, I looked at lib/hostip4.c to get an idea of the parameters types. void-cast variables such as 'rc' to avoid -Wuninitialized errors. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* cmake: drop _BSD_SOURCE macro usagePeter Wu2014-11-031-1/+0
| | | | | | | | autotools does not use features.h nor _BSD_SOURCE. As this macro triggers warnings since glibc 2.20, remove it. It should not have functional differences. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* Cmake: Build with GSSAPI (MIT or Heimdal)Jakub Zakrzewski2014-10-091-0/+289
| | | | | | | | | | | | It tries hard to recognise SDK's on different platforms. On windows MIT Kerberos installs SDK with other things and puts path into registry. Heimdal have separate zip archive. On linux pkg-config is tried, then krb5-config script and finally old-style libs and headers detection. Command line args: * CMAKE_USE_GSSAPI - enables GSSAPI detection * GSS_ROOT_DIR - if set, should point to the root of GSSAPI installation (the one with include and lib directories)
* Cmake: Avoid cycle directory dependencies.Jakub Zakrzewski2014-10-091-3/+3
| | | | | | Because we prepended libraries to list, CMake had troubles resolving link directory order as it detected some cycles. Appending to list ensures that dependencies will preceed dependees.