Включение/отключение сборки вариантов библиотеки через флаги CMake
This commit is contained in:
parent
357c19771f
commit
032fdee52b
@ -1,5 +1,10 @@
|
||||
# Создание динамической библиотеки из объектной библиотеки
|
||||
function(myx_cmake_add_shared_library target)
|
||||
myx_cmake_canonical_string(${target} _ctarget)
|
||||
option(BUILD_${_ctarget}_SHARED "build shared library ${_ctarget}" ON)
|
||||
if(NOT BUILD_${_ctarget}_SHARED)
|
||||
return()
|
||||
endif()
|
||||
get_target_property(__target_type ${target} TYPE)
|
||||
if(NOT __target_type STREQUAL OBJECT_LIBRARY)
|
||||
message(
|
||||
@ -19,5 +24,4 @@ function(myx_cmake_add_shared_library target)
|
||||
install(TARGETS ${target}-shared
|
||||
COMPONENT main
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
endfunction()
|
||||
|
@ -1,5 +1,10 @@
|
||||
# Создание статической библиотеки из объектной библиотеки
|
||||
function(myx_cmake_add_static_library target)
|
||||
myx_cmake_canonical_string(${target} _ctarget)
|
||||
option(BUILD_${_ctarget}_STATIC "build static library ${_ctarget}" ON)
|
||||
if(NOT BUILD_${_ctarget}_STATIC)
|
||||
return()
|
||||
endif()
|
||||
get_target_property(__target_type ${target} TYPE)
|
||||
if(NOT __target_type STREQUAL OBJECT_LIBRARY)
|
||||
message(
|
||||
|
Loading…
Reference in New Issue
Block a user