Merge branch 'master' of gitlab.2:f1x1t/cmlib
This commit is contained in:
commit
6ba37293b4
@ -9,7 +9,6 @@ include(CMLibDisableInSourceBuild)
|
|||||||
include(CMakeParseArguments)
|
include(CMakeParseArguments)
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
@ -24,9 +23,9 @@ include(CMLibLSBInfo)
|
|||||||
include(CMLibCompiler)
|
include(CMLibCompiler)
|
||||||
include(CMLibCompilerFlags)
|
include(CMLibCompilerFlags)
|
||||||
include(CMLibCompilerFeaturesHPPGenerate)
|
include(CMLibCompilerFeaturesHPPGenerate)
|
||||||
|
include(CMLibFlagRemove)
|
||||||
include(CMLibCommonTargetProperties)
|
include(CMLibCommonTargetProperties)
|
||||||
include(CMLibCommonLibraryTarget)
|
include(CMLibCommonLibraryTarget)
|
||||||
include(CMLibFlagRemove)
|
|
||||||
include(CMLibBuildTypes)
|
include(CMLibBuildTypes)
|
||||||
include(CMLibCodeAnalysisPvsStudio)
|
include(CMLibCodeAnalysisPvsStudio)
|
||||||
include(cotire)
|
include(cotire)
|
||||||
|
@ -10,16 +10,17 @@ function(add_common_library LIBNAME SOURCES)
|
|||||||
|
|
||||||
add_library(${LIBNAME}_shared SHARED $<TARGET_OBJECTS:${LIBNAME}>)
|
add_library(${LIBNAME}_shared SHARED $<TARGET_OBJECTS:${LIBNAME}>)
|
||||||
set_target_properties(${LIBNAME}_shared
|
set_target_properties(${LIBNAME}_shared
|
||||||
PROPERTIES VERSION ${PROJECT_VERSION}
|
PROPERTIES
|
||||||
|
VERSION ${PROJECT_VERSION}
|
||||||
SOVERSION ${PROJECT_VERSION_MAJOR}
|
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||||
OUTPUT_NAME ${LIBNAME}
|
OUTPUT_NAME ${LIBNAME}
|
||||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
|
||||||
add_library(${LIBNAME}_static STATIC $<TARGET_OBJECTS:${LIBNAME}>)
|
add_library(${LIBNAME}_static STATIC $<TARGET_OBJECTS:${LIBNAME}>)
|
||||||
set_target_properties(${LIBNAME}_static
|
set_target_properties(${LIBNAME}_static
|
||||||
PROPERTIES OUTPUT_NAME ${LIBNAME}
|
PROPERTIES
|
||||||
ARCHIVE_OUTPUT_DIRECTORY
|
OUTPUT_NAME ${LIBNAME}
|
||||||
${CMAKE_INSTALL_LIBDIR})
|
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
|
||||||
configure_file(${CMLIB_MODULE_DIR}/pc/lib.pc.in
|
configure_file(${CMLIB_MODULE_DIR}/pc/lib.pc.in
|
||||||
${CMAKE_BINARY_DIR}/${LIBNAME}.pc)
|
${CMAKE_BINARY_DIR}/${LIBNAME}.pc)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -8,6 +8,10 @@ function(common_target_properties Name)
|
|||||||
set(__visibility INTERFACE)
|
set(__visibility INTERFACE)
|
||||||
endif()
|
endif()
|
||||||
target_compile_features(${Name} ${__visibility} ${COMMON_CXX_FEATURES})
|
target_compile_features(${Name} ${__visibility} ${COMMON_CXX_FEATURES})
|
||||||
|
get_target_property(_targetType ${Name} TYPE)
|
||||||
|
if (_targetType STREQUAL "EXECUTABLE" AND CMAKE_CXX_COMPILE_OPTIONS_PIE)
|
||||||
|
target_compile_options(${Name} PUBLIC "${CMAKE_CXX_COMPILE_OPTIONS_PIE}")
|
||||||
|
endif()
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
${Name}
|
${Name}
|
||||||
PUBLIC $<INSTALL_INTERFACE:include>
|
PUBLIC $<INSTALL_INTERFACE:include>
|
||||||
@ -19,8 +23,9 @@ function(common_target_properties Name)
|
|||||||
endif()
|
endif()
|
||||||
if(NOT __interface)
|
if(NOT __interface)
|
||||||
if(TARGET Qt5::Core)
|
if(TARGET Qt5::Core)
|
||||||
target_compile_options(${Name}
|
if (_targetType STREQUAL "EXECUTABLE")
|
||||||
PUBLIC "${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
|
target_compile_options(${Name} PUBLIC "${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
|
||||||
|
endif()
|
||||||
set_target_properties(${Name} PROPERTIES AUTOMOC TRUE AUTORCC TRUE)
|
set_target_properties(${Name} PROPERTIES AUTOMOC TRUE AUTORCC TRUE)
|
||||||
endif()
|
endif()
|
||||||
if(TARGET Qt5::Widgets)
|
if(TARGET Qt5::Widgets)
|
||||||
|
@ -5,7 +5,7 @@ includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
|
|||||||
|
|
||||||
Name: @current_target@
|
Name: @current_target@
|
||||||
Description: @current_target@ library
|
Description: @current_target@ library
|
||||||
Version: @_ver@
|
Version: @PROJECT_VERSION@
|
||||||
|
|
||||||
Requires:
|
Requires:
|
||||||
Libs: -L@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ -l@current_target@
|
Libs: -L@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ -l@current_target@
|
||||||
|
Loading…
Reference in New Issue
Block a user