From 472245a8bd777830a7633e4bf6e0cb5da513a66a Mon Sep 17 00:00:00 2001 From: "Fiorentino Ing. Stefano" Date: Tue, 19 Oct 2021 13:39:03 +0000 Subject: [PATCH] install either static or shared lib only Close #246 Signed-off-by: Fiorentino Ing. Stefano --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a550705d..764c1cf3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,8 +164,12 @@ install(TARGETS uvw EXPORT uvwConfig ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} if(FETCH_LIBUV AND BUILD_UVW_LIBS) # libuv is only fetched when both above conditions are true install(DIRECTORY ${libuv_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/uvw/uv/include) - install(TARGETS uv_a EXPORT uvwConfig ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/uvw) - install(TARGETS uv EXPORT uvwConfig LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/uvw) + if (BUILD_UVW_SHARED_LIB) + install(TARGETS uv EXPORT uvwConfig LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/uvw) + else() + install(TARGETS uv_a EXPORT uvwConfig ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/uvw) + endif() + endif(FETCH_LIBUV AND BUILD_UVW_LIBS) ### Testing