Skip to content

Commit 472245a

Browse files
stefanofiorentinoskypjack
authored andcommitted
install either static or shared lib only
Close #246 Signed-off-by: Fiorentino Ing. Stefano <[email protected]>
1 parent c8c2cca commit 472245a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,12 @@ install(TARGETS uvw EXPORT uvwConfig ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
164164
if(FETCH_LIBUV AND BUILD_UVW_LIBS)
165165
# libuv is only fetched when both above conditions are true
166166
install(DIRECTORY ${libuv_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/uvw/uv/include)
167-
install(TARGETS uv_a EXPORT uvwConfig ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/uvw)
168-
install(TARGETS uv EXPORT uvwConfig LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/uvw)
167+
if (BUILD_UVW_SHARED_LIB)
168+
install(TARGETS uv EXPORT uvwConfig LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/uvw)
169+
else()
170+
install(TARGETS uv_a EXPORT uvwConfig ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/uvw)
171+
endif()
172+
169173
endif(FETCH_LIBUV AND BUILD_UVW_LIBS)
170174

171175
### Testing

0 commit comments

Comments
 (0)