Учитывать флаг BUILD_STATIC_LIBS
This commit is contained in:
parent
c21b108b47
commit
e90a2d9e7e
@ -16,13 +16,15 @@ function(add_common_library)
|
||||
$<INSTALL_INTERFACE:include/${LIBNAME}>)
|
||||
set_target_properties(${LIBNAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
add_library(${LIBNAME}_shared SHARED $<TARGET_OBJECTS:${LIBNAME}>)
|
||||
set_target_properties(${LIBNAME}_shared
|
||||
PROPERTIES
|
||||
VERSION ${PROJECT_VERSION}
|
||||
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||
OUTPUT_NAME ${LIBNAME}
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_library(${LIBNAME}_shared SHARED $<TARGET_OBJECTS:${LIBNAME}>)
|
||||
set_target_properties(${LIBNAME}_shared
|
||||
PROPERTIES
|
||||
VERSION ${PROJECT_VERSION}
|
||||
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||
OUTPUT_NAME ${LIBNAME}
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
|
||||
add_library(${LIBNAME}_static STATIC $<TARGET_OBJECTS:${LIBNAME}>)
|
||||
set_target_properties(${LIBNAME}_static
|
||||
|
Loading…
Reference in New Issue
Block a user