diff --git a/src/libcmex/CMakeLists.txt b/src/libcmex/CMakeLists.txt index 34c5077..d6a2912 100644 --- a/src/libcmex/CMakeLists.txt +++ b/src/libcmex/CMakeLists.txt @@ -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)