Compare commits
5 Commits
428dc84cfd
...
e90a2d9e7e
Author | SHA1 | Date | |
---|---|---|---|
e90a2d9e7e | |||
c21b108b47 | |||
f003cc6dcb | |||
6ba37293b4 | |||
5b305452e4 |
@@ -8,6 +8,9 @@ endif()
|
||||
include(CMLibDisableInSourceBuild)
|
||||
include(CMakeParseArguments)
|
||||
include(GNUInstallDirs)
|
||||
if(DEFINED ENV{DEB_HOST_MULTIARCH})
|
||||
string(APPEND CMAKE_INSTALL_LIBDIR "/$ENV{DEB_HOST_MULTIARCH}")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
@@ -30,7 +33,7 @@ include(CMLibBuildTypes)
|
||||
include(CMLibCodeAnalysisPvsStudio)
|
||||
include(cotire)
|
||||
|
||||
include(CMLibBreathe)
|
||||
#include(CMLibBreathe)
|
||||
include(CMLibQtTranslation)
|
||||
include(CMLibToday)
|
||||
include(CMLibConfigHPPGenerate)
|
||||
|
@@ -1,5 +1,13 @@
|
||||
# Создание статической и динамической библиотеки из одинаковых объектных файлов
|
||||
function(add_common_library LIBNAME SOURCES)
|
||||
function(add_common_library)
|
||||
set(options)
|
||||
set(oneValueArgs TARGET)
|
||||
set(multiValueArgs SOURCES)
|
||||
|
||||
cmake_parse_arguments(_LOCAL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
set(LIBNAME ${_LOCAL_TARGET})
|
||||
set(SOURCES ${_LOCAL_SOURCES})
|
||||
|
||||
add_library(${LIBNAME} OBJECT ${SOURCES})
|
||||
target_include_directories(
|
||||
${LIBNAME}
|
||||
@@ -8,6 +16,7 @@ function(add_common_library LIBNAME SOURCES)
|
||||
$<INSTALL_INTERFACE:include/${LIBNAME}>)
|
||||
set_target_properties(${LIBNAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_library(${LIBNAME}_shared SHARED $<TARGET_OBJECTS:${LIBNAME}>)
|
||||
set_target_properties(${LIBNAME}_shared
|
||||
PROPERTIES
|
||||
@@ -15,6 +24,7 @@ function(add_common_library LIBNAME SOURCES)
|
||||
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
|
||||
|
Reference in New Issue
Block a user