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

This commit is contained in:
Andrei Astafev 2019-03-14 11:22:14 +03:00
parent bae0bd6f66
commit 8137c598f7

View File

@ -11,7 +11,7 @@ set(current_target_headers
cmex.hpp
)
add_common_library(${current_target} ${current_target_sources})
add_common_library(TARGET ${current_target} SOURCES ${current_target_sources})
common_target_properties(${current_target})
# Цель, используемая только для установки заголовочных файлов без компиляции проекта
@ -22,7 +22,9 @@ add_custom_target(${current_target}-install-headers
# Правила для установки
install(TARGETS ${current_target}_static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(TARGETS ${current_target}_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(BUILD_SHARED_LIBS)
install(TARGETS ${current_target}_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
install(FILES ${CMAKE_BINARY_DIR}/include/config.hpp ${current_target_headers}
COMPONENT headers DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${current_target})
install(FILES ${CMAKE_BINARY_DIR}/${current_target}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)