cmake/AddEventLibrary.cmake


Log

Author Commit Date CI Message
Loïc Yhuel 657e1806 2020-11-23T17:24:36 cmake: do not link libevent with libevent_core When add_event_library macro was called without the INNER_LIBRARIES parameter, it reused the value set by a previous call, since the INNER_LIBRARIES variable was not reset.
yuangongji ce8be238 2020-01-20T21:17:27 cmake: set rpath for libraries on linux
Azat Khuzhin b9f442e2 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")
yuangongji dc4be869 2019-11-07T18:26:47 cmake: improve package config file
yuangongji 5fe83d74 2019-10-25T21:54:13 cmake: eliminate duplicate installation of public headers
Azat Khuzhin 55d1e20e 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")
yuangongji 669a53f3 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
Azat Khuzhin c9a073ea 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)
Philip Herron 0fa43c99 2018-04-05T15:17:06 cmake: ensure windows dll's are installed as well as lib files Closes: #621
Azat Khuzhin b1e8a413 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)")
Azat Khuzhin 882f537c 2017-03-13T21:40:52 cmake: fix pkgconfig generation (copy-paste typo)
Azat Khuzhin fd5a3fc0 2017-03-13T03:18:02 cmake: fix export absolute path and relative path and cleanup a bit Remove next vars, since I don't think that somebody want to change it: - bin - lib - include And fix exports problem: CMake Error: INSTALL(EXPORT "LibeventTargets") given absolute DESTINATION "/usr/lib/cmake/libevent" but the export references an installation of target "event_core_static" which has relative DESTINATION "lib".
Azat Khuzhin 86c73575 2017-03-13T02:26:39 cmake: generate and install pkgconfig files Fixes: #443
Azat Khuzhin 7182c2f5 2017-03-12T23:31:59 cmake: build SHARED and STATIC libraries (like autoconf does) Since they are useful for debugging, and if autotools build them then cmamke has to do this too, to make migration more simple. And now: - tests: uses shared libraries (since this is upstreams one) - other binaries: uses static libraries This removes next private config: - EVENT__NEED_DLLIMPORT