diff --git a/CMLibCommonLibraryTarget.cmake b/CMLibCommonLibraryTarget.cmake index fb9a558..e4b0e8f 100644 --- a/CMLibCommonLibraryTarget.cmake +++ b/CMLibCommonLibraryTarget.cmake @@ -27,12 +27,14 @@ function(add_common_library) install(TARGETS ${LIBNAME}_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() - add_library(${LIBNAME}_static STATIC $) - set_target_properties(${LIBNAME}_static - PROPERTIES - OUTPUT_NAME ${LIBNAME} - ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR}) - install(TARGETS ${LIBNAME}_static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + if(SKIP_STATIC_LIBS) + add_library(${LIBNAME}_static STATIC $) + set_target_properties(${LIBNAME}_static + PROPERTIES + OUTPUT_NAME ${LIBNAME} + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR}) + install(TARGETS ${LIBNAME}_static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() configure_file(${CMLIB_MODULE_DIR}/pc/lib.pc.in ${CMAKE_BINARY_DIR}/${LIBNAME}.pc)