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(