]> granicus.if.org Git - libevent/commitdiff
cmake: use APPEND during exporting targets (for old cmake)
authorAzat Khuzhin <a3at.mail@gmail.com>
Tue, 14 Mar 2017 10:33:31 +0000 (13:33 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Tue, 14 Mar 2017 10:37:59 +0000 (13:37 +0300)
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)")

cmake/AddEventLibrary.cmake

index 23a8d4ca89fb459e628ca5261a253cfd83e57e30..8475e086bc60427179e1e0dc5371cf2d4499a941 100644 (file)
@@ -91,6 +91,7 @@ macro(add_event_library LIB_NAME)
 
     export(TARGETS "${LIB_NAME}_static" "${LIB_NAME}_shared"
        FILE "${PROJECT_BINARY_DIR}/LibeventTargets.cmake"
+       APPEND
     )
 
     install(TARGETS "${LIB_NAME}_static" "${LIB_NAME}_shared"