From 596855f7af6dc1b6e3432e0188897ac581269821 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Fri, 12 Jul 2019 00:00:12 +0300 Subject: [PATCH] cmake: install shared library only if it was requested $ cmake -DEVENT__LIBRARY_TYPE=static .. ... CMake Error: Error evaluating generator expression: $ 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) --- cmake/AddEventLibrary.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/AddEventLibrary.cmake b/cmake/AddEventLibrary.cmake index 12a36831..352c86ba 100644 --- a/cmake/AddEventLibrary.cmake +++ b/cmake/AddEventLibrary.cmake @@ -149,7 +149,7 @@ macro(add_event_library LIB_NAME) PUBLIC_HEADER DESTINATION "include/event2" COMPONENT dev ) - if (NOT WIN32) + if (NOT WIN32 AND ${EVENT_LIBRARY_SHARED}) install(FILES "$/${LIB_LINK_NAME}" DESTINATION "lib"