Правила для установки библиотек

This commit is contained in:
Andrei Astafev 2019-03-07 21:47:04 +03:00
parent d4af232127
commit 0848b7313f

View File

@ -24,6 +24,7 @@ function(add_common_library)
SOVERSION ${PROJECT_VERSION_MAJOR}
OUTPUT_NAME ${LIBNAME}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
install(TARGETS ${LIBNAME}_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
add_library(${LIBNAME}_static STATIC $<TARGET_OBJECTS:${LIBNAME}>)
@ -31,6 +32,8 @@ function(add_common_library)
PROPERTIES
OUTPUT_NAME ${LIBNAME}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
install(TARGETS ${LIBNAME}_static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
configure_file(${CMLIB_MODULE_DIR}/pc/lib.pc.in
${CMAKE_BINARY_DIR}/${LIBNAME}.pc)
endfunction()