Флаг для пропуска сборки статических библиотек

This commit is contained in:
Andrei Astafev 2019-03-07 21:57:24 +03:00
parent 0848b7313f
commit 572c4b9d0f

View File

@ -27,12 +27,14 @@ function(add_common_library)
install(TARGETS ${LIBNAME}_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
if(SKIP_STATIC_LIBS)
add_library(${LIBNAME}_static STATIC $<TARGET_OBJECTS:${LIBNAME}>)
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)