From 4851c81b1589e1aa9841e97e6d7b2b2b5925167d Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Mon, 13 Dec 2021 13:57:11 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BB=D1=8F=20=D0=B1=D0=B8=D0=B1=D0=BB?= =?UTF-8?q?=D0=B8=D0=BE=D1=82=D0=B5=D0=BA=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20=D1=86=D0=B5=D0=BB=D1=8C=20=D0=B2?= =?UTF-8?q?=D0=B8=D0=B4=D0=B0=20${target}-install-headers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MyxCMake/modules/MyxCMakeCommonTargetProperties.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MyxCMake/modules/MyxCMakeCommonTargetProperties.cmake b/MyxCMake/modules/MyxCMakeCommonTargetProperties.cmake index 25c594f..4466939 100644 --- a/MyxCMake/modules/MyxCMakeCommonTargetProperties.cmake +++ b/MyxCMake/modules/MyxCMakeCommonTargetProperties.cmake @@ -71,6 +71,13 @@ function(myx_cmake_common_target_properties target) set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() + if(_target_type MATCHES "_LIBRARY$" AND NOT ${target}-install-headers) + # Цель, используемая только для установки заголовочных файлов без компиляции проекта + add_custom_target(${target}-install-headers + COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=dev + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") + endif() + # LTO only for executables (not libraries) in Release build type if(_target_type STREQUAL EXECUTABLE AND CMAKE_BUILD_TYPE STREQUAL Release) check_cxx_compiler_flag(-flto CXX_HAS_LTO_FLAG)