Для библиотек добавлена цель вида ${target}-install-headers
This commit is contained in:
parent
e81a491606
commit
4851c81b15
@ -71,6 +71,13 @@ function(myx_cmake_common_target_properties target)
|
|||||||
set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||||
endif()
|
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
|
# LTO only for executables (not libraries) in Release build type
|
||||||
if(_target_type STREQUAL EXECUTABLE AND CMAKE_BUILD_TYPE STREQUAL Release)
|
if(_target_type STREQUAL EXECUTABLE AND CMAKE_BUILD_TYPE STREQUAL Release)
|
||||||
check_cxx_compiler_flag(-flto CXX_HAS_LTO_FLAG)
|
check_cxx_compiler_flag(-flto CXX_HAS_LTO_FLAG)
|
||||||
|
Loading…
Reference in New Issue
Block a user