From 032fdee52bda05146028ea2623a6fc262bd14ed5 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Fri, 10 Dec 2021 11:13:43 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5/=D0=BE=D1=82=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D0=B8=20=D0=B2?= =?UTF-8?q?=D0=B0=D1=80=D0=B8=D0=B0=D0=BD=D1=82=D0=BE=D0=B2=20=D0=B1=D0=B8?= =?UTF-8?q?=D0=B1=D0=BB=D0=B8=D0=BE=D1=82=D0=B5=D0=BA=D0=B8=20=D1=87=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=B7=20=D1=84=D0=BB=D0=B0=D0=B3=D0=B8=20CMake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MyxCMake/modules/MyxCMakeAddSharedLibrary.cmake | 6 +++++- MyxCMake/modules/MyxCMakeAddStaticLibrary.cmake | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/MyxCMake/modules/MyxCMakeAddSharedLibrary.cmake b/MyxCMake/modules/MyxCMakeAddSharedLibrary.cmake index a47ec6f..7a4100f 100644 --- a/MyxCMake/modules/MyxCMakeAddSharedLibrary.cmake +++ b/MyxCMake/modules/MyxCMakeAddSharedLibrary.cmake @@ -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() diff --git a/MyxCMake/modules/MyxCMakeAddStaticLibrary.cmake b/MyxCMake/modules/MyxCMakeAddStaticLibrary.cmake index 8c51658..90e52e3 100644 --- a/MyxCMake/modules/MyxCMakeAddStaticLibrary.cmake +++ b/MyxCMake/modules/MyxCMakeAddStaticLibrary.cmake @@ -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(