cmake


Log

Author Commit Date CI Message
yuangongji 813cc739 2020-01-20T21:17:27 cmake: set rpath for libraries on linux (cherry picked from commit ce8be2385b5fee16859a630fca0c98ad290c8e21)
Azat Khuzhin 2cfa7ff7 2020-06-28T22:31:41 Bump version to 2.1.12-stable (w/o ABI breakage)
yuangongji 9a94cd9b 2020-05-27T15:39:49 remove FindGit.cmake, improve `git describe` command (cherry picked from commit a9aa2b3607c8adf9846aa6a01e070130f4d6dcb9)
yuangongji a6974d11 2020-05-01T09:51:29 cmake: set a default value for LIBEVENT_STATIC_LINK (cherry picked from commit 86eafc03433cb5719e5b75ff99ffab8633433a17)
yuangongji 13af9d26 2020-03-20T17:49:37 cmake: replace CheckFunctionExists with CheckSymbolExists Checking functions with `CheckFunctionExists` may get wrong results, we should replace it with `CheckSymbolExists`, which is recommended by the cmake official documentation. Before using `CheckSymbolExists`, we use `CheckIncludeFiles` to check header files and save the available header files in a variable that guarantees `CheckSymbolExists` and `CheckTypeSize` to work correctly. This approach is modeled after the cmake scripts of `curl`. The following functions or files were not found before modification, they can now be found: - msys2 + mingw-8.1.0 on Windows10 or mingw-7.3.0 on Ubuntu-18.04 timerclear timercmp timerisset - windows10 getaddrinfo getnameinfo getprotobynumber getservbyname putenv strtoll timerclear timercmp timerisset - ubuntu-18.04 sys/sysctl.h timeradd timerclear timercmp timerisset - MacOS 10.13 sys/random.h timeradd timerclear timercmp timerisset (cherry picked from commit 41d1d75a84e03219ec037b0f7982a67fb031eae7)
Mario Emmenlauer 640f9cf6 2020-03-03T19:02:24 LibeventConfig.cmake: restore CMAKE_FIND_LIBRARY_SUFFIXES and LIBEVENT_STATIC_LINK default The current cmake/LibeventConfig.cmake.in has a few problems and I'm not sure how cleanly developed it is. It seems rater complex for the little things I would assume it needs to do. I found two problems that are fixed in this PR: - If the downstream user does not explicitly set LIBEVENT_STATIC_LINK before calling find_package(libevent) then they will not be able to detect the static library, even if its the only one that exists. Since this may be rather strict, I've changed the behavior so that LIBEVENT_STATIC_LINK can be set to ON or OFF, but if unset, it defaults to whatever configuration libevent was built as. - The other problem is a bug. The package configuration needs to unset CMAKE_FIND_LIBRARY_SUFFIXES after use, otherwise all packages that are detected after libevent will be "infected" by this setting. This was a significant problem for us, and is very hard to detect in downstream project, because the order of dependencies will lead to different search results. (cherry picked from commit 1675a55620e6f0bbba5776f2df72cd48920421c2)
yuangongji dea51c2e 2020-03-16T20:11:06 cmake: fix getaddrinfo checking error Using `CheckFunctionExists` on Windows to check `getaddrinfo` will get `not found`, but it actually exists. Using `CheckSymbolExists` with headers will get correct results. Other functions such as `getnameinfo`,`inet_ntop`,etc. have the same issue. (cherry picked from commit 503ba1d36571e3cb01826d15dc462b7d8b5094de)
yuangongji 88384865 2020-03-16T18:57:54 cmake: remove CheckFunctionExistsEx `CheckFunctionExistsEx` is copied from the cmake modules before 3.1.2, which is the minimum required version of libevent. The internal module `CheckFunctionExists`of cmake can completely replace it. (cherry picked from commit 61c5c19bfdabd2f16407a3ed615060c9d0502e82)
Azat Khuzhin 47eb8c12 2019-11-30T15:53:52 cmake: use CMAKE_LIBRARY_OUTPUT_DIRECTORY for the final shared library symlink Fixes: 669a53f3 ("cmake: set library names to be the same as with autotools") (cherry picked from commit b9f442e2d7af8b01cd34f75f2f404763b76d42dc)
yuangongji 1c047618 2019-11-07T18:26:47 cmake: improve package config file (cherry picked from commit dc4be869d5009f38e0ef02ff07dd799f9c2fef2f)
yuangongji a9d1121d 2019-10-25T21:54:13 cmake: eliminate duplicate installation of public headers (cherry picked from commit 5fe83d7433022e29a401753f64ec78faaf25e0a7)
yuangongji 7a85300a 2019-08-23T21:48:05 cmake: attach doxygen target into all target v2: Disable non-html generator for doxygen by default v3: convert cmake option to doxygen config (cherry picked from commit 1d1c19091f13b7e19015698a23f454aa85f17ac3)
Azat Khuzhin 5b723a66 2019-08-02T00:23:11 Bump version to 2.1.11-stable (with ABI breakage)
Azat Khuzhin 596855f7 2019-07-12T00:00:12 cmake: install shared library only if it was requested $ cmake -DEVENT__LIBRARY_TYPE=static .. ... CMake Error: Error evaluating generator expression: $<TARGET_FILE_DIR:event_core_shared> No target "event_core_shared" Fixes: #853 Fixes: 669a53f3 ("cmake: set library names to be the same as with autotools") (cherry picked from commit 55d1e20e1a5dbd1188f4143968f7cafee33edc0d)
yuangongji 305251b9 2019-07-10T00:30:12 cmake: set library names to be the same as with autotools libtool has VERSION_INFO [1], cmake has SOVERSION/VERSION instead (although it has different format). Also libtool has RELEASE [2] while cmake do not have analog yet [3], hence manual symlinks should be created. [1]: https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html [2]: https://www.gnu.org/software/libtool/manual/html_node/Release-numbers.html [3]: https://gitlab.kitware.com/cmake/cmake/issues/17652 Plus osx has compatibility_version/current_version dylib properties and cmake do not have separate properties for them [4], hence manual LINK_FLAGS. And also there INSTALL_NAME_DIR property which should be adjusted too. [4]: https://public.kitware.com/Bug/view.php?id=4383 So after all changes, here is an example before/after for osx and linux: # osx # autotools .libs/libevent_pthreads-2.2.1.dylib .libs/libevent_pthreads.dylib -> libevent_pthreads-2.2.1.dylib /usr/local/lib/libevent_pthreads-2.2.1.dylib (compatibility version 2.0.0, current version 2.0.0) # cmake # before patch lib/libevent_pthreads.2.2.0.dylib lib/libevent_pthreads.dylib -> libevent_pthreads.2.2.0.dylib @rpath/libevent_pthreads.2.2.0.dylib (compatibility version 2.2.0, current version 0.0.0) # after patch lib/libevent_pthreads-2.2.1.dylib lib/libevent_pthreads.dylib -> libevent_pthreads-2.2.1.dylib /vagrant/.cmake/inst/lib/libevent_pthreads-2.2.1.dylib (compatibility version 2.0.0, current version 2.0.0) # linux # autotools .libs/libevent_pthreads-2.2.so.1 -> libevent_pthreads-2.2.so.1.0.0 .libs/libevent_pthreads-2.2.so.1.0.0 .libs/libevent_pthreads.so -> libevent_pthreads-2.2.so.1.0.0 # cmake # before patch lib/libevent_pthreads.so -> libevent_pthreads.so.2.2.0 lib/libevent_pthreads.so.2.2.0 # after patch lib/libevent_pthreads-2.2.so -> libevent_pthreads-2.2.so.1 lib/libevent_pthreads-2.2.so.1 -> libevent_pthreads-2.2.so.1.0.0 lib/libevent_pthreads-2.2.so.1.0.0 lib/libevent_pthreads.so -> libevent_pthreads-2.2.so.1.0.0 Closes: #838 (cherry-picked) Closes: #760 (cherry picked from commit 669a53f341e192657140952cfe025c260da2b1c1)
yuangongji 2d65071c 2019-06-09T20:15:37 cmake: add missing autotools targets (doxygen, uninstall, event_rpcgen.py) Close: #832 (cherry-picked) (cherry picked from commit 7201062f3ef505a77baa6ccaf1cf73812462308a)
Azat Khuzhin f5bfd721 2019-05-25T22:33:45 Bump version to 2.1.10-stable everywhere
Enji Cooper c5cf4a5c 2019-02-28T17:22:30 Fix typos in a comment describing the purpose of `VersionViaGit.cmake` Signed-off-by: Enji Cooper <yaneurabeya@gmail.com> (cherry picked from commit 0b468bb07e3476d06907ca6c8e5c24bbb05e31a4)
Azat Khuzhin 900f5c45 2019-02-03T19:19:46 Bump version to 2.1.9-beta everywhere
Azat Khuzhin eb10a738 2018-11-22T23:00:11 cmake: introduce EVENT__LIBRARY_TYPE option Long time ago in [1] cmake build was forced to compile both libraries (SHARED and STATIC), since this is how our autotools build works. [1]: 7182c2f561570cd9ceb704623ebe9ae3608c7b43 ("cmake: build SHARED and STATIC libraries (like autoconf does)") And there is no way to configure this (and indeed you need to do this for MSVC for example), so let's introduce option for this -- EVENT__LIBRARY_TYPE. Plus now we have INTERFACE libraries, that we can use internally in libevent's cmake rules to avoid strict to _shared/_static variant of the libraries to link with samples/tests (we prefer SHARED over STATIC for linking). Also bump minimal cmake required version to 3.1 by the following reasons: - 3.1 is required for RPATH configuration under APPLE - 3.0 is required for add_library(INTERFACE) (did not found it in 2.8.x documentation) - remove extra conditions (anyway 3.1 was release 4 years ago, so I guess that most of the systems will have it) (cherry picked from commit c9a073eae8f86a74fbbb125db34b881ef40108b7)
Azat Khuzhin 235b5521 2018-10-18T23:16:05 Make cmake's check_const_exists() rely on cache (cherry picked from commit 4c61a04cd5207f2140b65f955559aa4ffc848e9c)
Azat Khuzhin 44fa5b19 2018-04-23T01:50:55 Fix CheckFunctionExistsEx() cmake macro on win32 For example under mingw64 it could not detect that strtok_r() exists, because it checks with: void *p = func_name; And for this you need the function to be defined, so just sync our CheckFunctionExistsEx.c with CheckFunctionExists.c from cmake (and later we should drop them out) since it does correct things to detech functions existence. Also for WIN32 there is -FIwinsock2.h -FIws2tcpip.h, and I guess that is not works for mingw gcc (since -F in gcc is framework, and in windows -FI is like -include in gcc). But looks like we do not need them already (due to fixed CheckFunctionExistsEx()). Refs: #605 (cherry picked from commit accf383e044257ecdef002ea255056a5d15a4811)
Philip Herron 29590718 2018-04-05T15:17:06 cmake: ensure windows dll's are installed as well as lib files Closes: #621 (cherry picked from commit 0fa43c99fbba6f3b1827ada98302f548206a358f)
Carlo Marcelo Arenas Belón 9c720b70 2017-08-19T16:01:46 configure: avoid false positive in DragonFlyBSD by default, the max buffer size is 16K and histeresis is at 50%, so a bigger read is needed to unlock writes than you would expect from other BSD (512 bytes) this doesn't introduce any regression on FreeBSD 11.1, OpenBSD 6.1, NetBSD 7.1, macOS 10.12.6 and of course DragonFlyBSD 4.8.1, and most of them show a max pipe size of 64K, so the read call should drain them all regardless of how conservative they are on the free pipe space they will require (usually 512 bytes) before kevent reports the fd as ready for write. I couldn't find a reference to which bug this code was trying to look for and it seems to be there from the beginning of git history so it might be no longer relevant. Issue: #548 (cherry picked from commit 1dfec8a97094a26317eac9b3d8a1c16eb1a7dbea)
Azat Khuzhin 5398cbcd 2017-03-14T13:33:31 cmake: use APPEND during exporting targets (for old cmake) On centos with cmake 2.8.12.2: CMake Error at cmake/AddEventLibrary.cmake:92 (export): export called with target "event_extra_shared" which requires target "event_core_shared" that is not in the export list. If the required target is not easy to reference in this call, consider using the APPEND option with multiple separate calls. But on newer cmake I guess everything is ok. Fixes: 7182c2f561570cd9ceb704623ebe9ae3608c7b43 ("cmake: build SHARED and STATIC libraries (like autoconf does)") (cherry picked from commit b1e8a4138f0da3c8a4bc303ff72b620b41c066d6)
Azat Khuzhin cc554d87 2017-03-13T21:40:52 cmake: fix pkgconfig generation (copy-paste typo) (cherry picked from commit 882f537c409d9c51ede581a3e13de7519227edb7)
Azat Khuzhin 9806b126 2017-03-13T21:05:32 Merge branch 'cmake-missing-bits' This patchset adds next missing things (in compare to autotools): - pkgconfig - event_pthreads/event_openssl - compile shared/static libraries always And some fixes, because it will not build after fixing other things: - export missing symbols for cmake (-fvisibility=hidden) * cmake-missing-bits: cmake: support visibility for AppleClang too cmake: fix export absolute path and relative path and cleanup a bit cmake: generate and install pkgconfig files cmake: build SHARED and STATIC libraries (like autoconf does) cmake: add missing event_openssl/event_pthreads libraries Export symbols for -fvisibility=hidden (under cmake) Refs: #246 (cherry picked from commit 489991a2b2628ba1ff4e6879b9f67ec35d224c38)
Azat Khuzhin a0bfe2c4 2017-03-08T17:58:26 Merge branch 'cmake-configure-fixes-v2' Fixes in cmake, to make it more like configure and support some cross-compiling. * cmake-configure-fixes-v2: cmake: fix extracting of the version from git (check for number of matches) Detect arch4random_addrandom() existence Use off_t instead of ev_off_t for sendfile() (fixes android build) cmake: detect _GNU_SOURCE not by __GNU_LIBRARY__ only (fallback to _GNU_SOURCE) Check for WNOWAIT in waitpid() in runtime (not in cmake/configure) cmake: add <pthread.h> into CMAKE_REQUIRED_INCLUDES for sizeof(pthread_t) cmake: fix values for #cmakedefine cmake: drop duplicates from event-config template cmake: add value for the #cmakedefine macros (like autoconf) cmake: Fix checking of enum values from sysctl.h (cherry picked from commit 5aade2d30b6c5eff226cbf7b63fda5a01987ba4f)
Azat Khuzhin 3a1f47fd 2017-01-29T19:32:10 Do not overwrite version from GIT if it is older then defaults (cherry picked from commit 0344edf62dc49d822315a8d832f17be8d2c43643)
Azat Khuzhin 9b63b5d4 2017-01-22T18:21:57 Bump version to 2.1.8-stable everywhere P.S. in referenced commit I made a mistake and instead of *-rc* I wrote *-beta*. See-also: f4489b8323cda0bf8eed7c1353911a852d7a947c ("Bump version to 2.1.7-beta everywhere")
Azat Khuzhin f4489b83 2016-11-02T00:31:31 Bump version to 2.1.7-beta everywhere - cmake basic - cmake detecting from git -- event_fuzzy_version_from_git() - autotools - win32 - appveyor
Azat Khuzhin 40fbffc0 2016-11-01T23:33:11 Fix cmake -DEVENT__COVERAGE=ON - do not use compiler check from the root cmake rules with syntax error, let CodeCoverage check it - fix CodeCoverage to check C compiler not CXX - case insensitive checking of CMAKE_BUILD_TYPE - replace flags with --coverage, and fix flags with linking with --coverate, otherwise it will not compile during checking flags and fails.
Azat Khuzhin 43b69b2a 2016-10-26T18:04:07 cmake: fix CheckFunctionExistsEx/CheckPrototypeDefinition (CMP0054)
Azat Khuzhin 51019e94 2016-07-13T17:40:48 Bump version to 2.1.6-beta everywhere - cmake basic - cmake detecting from git -- event_fuzzy_version_from_git() - autotools - win32 - appveyor
Azat Khuzhin 43eb56c7 2016-08-11T16:15:45 tests: use waitpid(..., WNOWAIT) to fix failing of main/fork under solaris According to solaris docs: "One instance of a SIGCHLD signal is queued for each child process whose status has changed. If waitpid() returns because the status of a child process is available, and WNOWAIT was not specified in options, any pending SIGCHLD signal associated with the process ID of that child process is discarded. Any other pending SIGCHLD signals remain pending." And interesting thing that it works if you add sleep(1) before waitpid(), and also if you run with --verbose (some race or what). But linux doesn't support WNOWAIT in waitpid() so add detection into cmake/autotools. Fixes: #387 Link: https://bugzilla.redhat.com/show_bug.cgi?id=840782
Azat Khuzhin 36588e16 2016-03-10T00:33:04 cmake: fix adding of compiler flags, and now it will - add_compiler_flags() must accept array IOW just ARGN will be enoough - add_compiler_flags() called with variable name instead of it's value P.S. and fix some alignments issues P.P.S. more cmake issues expected since now CFLAGS actually works P.P.P.S. some issues with cmake cache is possible, so just reset it
Mark Ellzey 49a53811 2015-12-20T21:44:04 More cmake updates, lot's of missing definitions
Mark Ellzey a9db46ae 2015-12-20T00:43:46 CMAKE CMAKE CMAKE CLEANUPS It's almost useful.
Mark Ellzey 8b228e27 2015-12-19T01:47:49 Lot's of cmake updates This is still not done, cmake here was a horrid mess, but we're getting our act together now.
Joakim Söderberg 19ba4543 2015-02-05T00:56:58 This fixes a bug introduced in 27bd9faf498b91923296cc91643e03ec4055c230 CMake configuration files are intended to be used by other projects to find the library. Specifically the CMake find_package command can use it to find all files related to the project. The idea is to support 2 different CMake configuration files for Libevent. One if you simply build libevent that is generated for the build tree. And a second one that is generated for an install target that will be installed on the system and point to where on the system the lib files and such can be find. So for instance, in the build tree the config would set the cmake variable `LIBEVENT_INCLUDE_DIRS` to `/path/to/libevent/build/include`. And for the system config it would be set to `/usr/local/include` (or whatever target the user chose when running cmake). 27bd9faf498b91923296cc91643e03ec4055c230 changed this behavior so that both configs would point to the system wide path `/usr/local/include` This meant that projects just wanting to import directly for the build tree would fail.
Acer Yang befbd130 2014-09-20T15:25:53 Fix cmake error when the Module path has more than one entry. CMAKE_MODULE_PATH is usually a list instead of single entry. Especially for projects contain sub cmake projects. My patch replace the CMAKE_MODULE_PATH with fixed path, to locate the `.in` file.
Sergey Nikulov 27bd9faf 2014-09-02T18:25:52 updates in cmake build
Joakim Söderberg 2b41bcf8 2014-03-07T18:09:56 Export event_extra not event_extras.
Joakim Söderberg 4e143958 2014-01-21T11:30:27 Change all uses of WIN32 to _WIN32
Joakim Soderberg 49ab3632 2014-01-14T13:01:31 Some work on making it possible to simply do add_subdirectory() on the project.
Joakim Soderberg f3446ed5 2014-01-09T13:44:38 Add CMake config and install targets. Make it easier for other projects to do find_package by creating config files both in the build and install tree.
Joakim Soderberg f7805939 2013-12-19T10:46:04 Only look for ZLib when it is used (if tests are included). Also make the project language C.
Joakim Soderberg f2483f8b 2013-12-17T15:17:29 Add a "make verify_coverage" target generation coverage info. Use lcov/gcov to gather coverage info for the tests (Only works with gcc/clang and make). cmake -DEVENT__COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug .. make make verify_coverage Current coverage (run on debian): Line coverage 79.1 % 10231 / 12939 Function coverage 86.1 % 933 / 1083
Joakim Söderberg 2799b359 2013-12-17T14:01:21 Added a test for testing if kqueue works with pipes.
Joakim Soderberg c259d53c 2013-12-16T11:27:13 Add copyright and licensing files for CMake modules.
Joakim Soderberg e415196a 2013-12-09T18:05:32 Initial CMake commit.