diff --git a/CMLibCommonLibraryTarget.cmake b/CMLibCommonLibraryTarget.cmake index 541d6c2..787cb08 100644 --- a/CMLibCommonLibraryTarget.cmake +++ b/CMLibCommonLibraryTarget.cmake @@ -19,21 +19,22 @@ function(add_common_library target) $ $) set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON) + # cmake-format: off if(BUILD_SHARED_LIBS) add_library(${target}_shared SHARED $) - set_target_properties( - ${target}_shared - PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} OUTPUT_NAME ${OUTNAME} - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR}) + set_target_properties(${target}_shared PROPERTIES OUTPUT_NAME ${OUTNAME} + VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) install(TARGETS ${target}_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() if(NOT SKIP_STATIC_LIBS) add_library(${target}_static STATIC $) - set_target_properties(${target}_static PROPERTIES OUTPUT_NAME ${OUTNAME} ARCHIVE_OUTPUT_DIRECTORY - ${CMAKE_INSTALL_LIBDIR}) + set_target_properties(${target}_static PROPERTIES OUTPUT_NAME ${OUTNAME} + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) install(TARGETS ${target}_static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() + # cmake-format: on configure_file(${CMLIB_MODULE_DIR}/pc/lib.pc.in ${CMAKE_BINARY_DIR}/${target}.pc) install(FILES ${CMAKE_BINARY_DIR}/${target}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)