Версия 0.5.5
This commit is contained in:
parent
06f7013273
commit
e1badf6f69
@ -1,5 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0)
|
||||||
project(myx-cmake VERSION 0.5.3 LANGUAGES)
|
project(myx-cmake VERSION 0.5.5 LANGUAGES)
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake
|
file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
function(myx_cmake_compile_target_properties target)
|
function(myx_cmake_common_target_properties target)
|
||||||
|
|
||||||
if(NOT TARGET ${target})
|
if(NOT TARGET ${target})
|
||||||
myx_cmake_message_error("MyxCMake: Target ${target} does not exists.")
|
myx_cmake_message_error("MyxCMake: Target ${target} does not exists.")
|
||||||
endif()
|
endif()
|
||||||
@ -49,6 +48,8 @@ function(myx_cmake_compile_target_properties target)
|
|||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
target_compile_features(${target} ${__visibility} cxx_alias_templates cxx_nullptr cxx_override)
|
target_compile_features(${target} ${__visibility} cxx_alias_templates cxx_nullptr cxx_override)
|
||||||
if(_target_type STREQUAL EXECUTABLE)
|
if(_target_type STREQUAL EXECUTABLE)
|
||||||
set_target_properties(${target} PROPERTIES
|
set_target_properties(${target} PROPERTIES
|
||||||
@ -68,8 +69,6 @@ function(myx_cmake_compile_target_properties target)
|
|||||||
set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# LTO only for executables (not libraries) in Release build type
|
# LTO only for executables (not libraries) in Release build type
|
||||||
if(_target_type STREQUAL EXECUTABLE AND CMAKE_BUILD_TYPE STREQUAL Release)
|
if(_target_type STREQUAL EXECUTABLE AND CMAKE_BUILD_TYPE STREQUAL Release)
|
||||||
check_cxx_compiler_flag(-flto CXX_HAS_LTO_FLAG)
|
check_cxx_compiler_flag(-flto CXX_HAS_LTO_FLAG)
|
||||||
@ -105,12 +104,6 @@ function(myx_cmake_compile_target_properties target)
|
|||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
${target} ${__visibility}
|
${target} ${__visibility}
|
||||||
"MYX_CMAKE_LSB_CODENAME_${MYX_CMAKE_LSB_CODENAME}")
|
"MYX_CMAKE_LSB_CODENAME_${MYX_CMAKE_LSB_CODENAME}")
|
||||||
endfunction()
|
|
||||||
|
|
||||||
|
|
||||||
function(myx_cmake_common_target_properties target)
|
|
||||||
|
|
||||||
myx_cmake_compile_target_properties(${target})
|
|
||||||
|
|
||||||
myx_cmake_analyze_clang_tidy(${target})
|
myx_cmake_analyze_clang_tidy(${target})
|
||||||
myx_cmake_analyze_clang_check(${target})
|
myx_cmake_analyze_clang_check(${target})
|
||||||
@ -157,35 +150,6 @@ function(myx_cmake_common_target_properties target)
|
|||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
function(myx_cmake_qt_autogen_target_properties target)
|
|
||||||
|
|
||||||
myx_cmake_compile_target_properties(${target})
|
|
||||||
|
|
||||||
get_target_property(_target_type ${target} TYPE)
|
|
||||||
if(NOT _target_type STREQUAL OBJECT_LIBRARY)
|
|
||||||
myx_cmake_message_error("MyxCMake: Target ${target} must have type OBJECT ${_target_type}.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
get_target_property(__sources ${target} SOURCES)
|
|
||||||
foreach(src IN LISTS __sources)
|
|
||||||
string(REGEX MATCH ".*/ui_.*\\.h$" __ui ${src})
|
|
||||||
if(__ui)
|
|
||||||
target_include_directories(${target} SYSTEM PUBLIC ${Qt5Widgets_INCLUDE_DIRS})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
foreach(src IN LISTS __sources)
|
|
||||||
string(REGEX MATCH ".*/moc_.*\\.cpp$" __moc ${src})
|
|
||||||
if(__moc)
|
|
||||||
target_include_directories(${target} SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
set_target_properties(${target} PROPERTIES CXX_CLANG_TIDY "")
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
|
|
||||||
function(myx_cmake_common_target_properties_post_link target)
|
function(myx_cmake_common_target_properties_post_link target)
|
||||||
if(NOT TARGET ${target})
|
if(NOT TARGET ${target})
|
||||||
myx_cmake_message_error("MyxCMake: Target ${target} does not exists.")
|
myx_cmake_message_error("MyxCMake: Target ${target} does not exists.")
|
||||||
|
Loading…
Reference in New Issue
Block a user