Опечатки

This commit is contained in:
Andrei Astafev 2023-08-01 12:03:08 +03:00
parent b1f6805c5e
commit 03832447bf

View File

@ -2,6 +2,7 @@ include_guard(GLOBAL)
function(myx_target_setup_qt TARGET_NAME) function(myx_target_setup_qt TARGET_NAME)
set(options) set(options)
set(oneValueArgs)
set(multiValueArgs COMPONENTS PRIVATE PUBLIC_MOC PRIVATE_MOC UI QRC LANGS) set(multiValueArgs COMPONENTS PRIVATE PUBLIC_MOC PRIVATE_MOC UI QRC LANGS)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@ -18,15 +19,20 @@ function(myx_target_setup_qt TARGET_NAME)
get_target_property(__target_type ${TARGET_NAME} TYPE) get_target_property(__target_type ${TARGET_NAME} TYPE)
foreach(iter ${ARG_COMPONENTS}) foreach(iter ${ARG_COMPONENTS})
if(__target_type STREQUAL "INTERFACE_LIBRARY")
target_include_directories(${TARGET_NAME} INTERFACE ${Qt5${iter}_INCLUDE_DIRS})
else()
target_include_directories(${TARGET_NAME} PRIVATE ${Qt5${iter}_INCLUDE_DIRS})
endif()
if(NOT iter STREQUAL "LinguistTools") if(NOT iter STREQUAL "LinguistTools")
if(__target_type STREQUAL "EXECUTABLE") if(__target_type STREQUAL "EXECUTABLE")
target_link_libraries(${TARGET_NAME} PRIVATE "Qt${myx_qt_ver}::${iter}") target_link_libraries(${TARGET_NAME} PRIVATE Qt${myx_qt_ver}::${iter})
endif() endif()
if(__target_type STREQUAL "SHARED_LIBRARY") if(__target_type STREQUAL "SHARED_LIBRARY")
target_link_libraries(${TARGET_NAME} PUBLIC "Qt${myx_qt_ver}::${iter}") target_link_libraries(${TARGET_NAME} PUBLIC Qt${myx_qt_ver}::${iter})
endif() endif()
if((${CMAKE_VERSION} VERSION_GREATER "3.8.0") AND (__target_type STREQUAL "OBJECT_LIBRARY")) if((${CMAKE_VERSION} VERSION_GREATER "3.8.0") AND (__target_type STREQUAL "OBJECT_LIBRARY"))
target_link_libraries(${TARGET_NAME} PUBLIC "Qt${myx_qt_ver}:${iter}") target_link_libraries(${TARGET_NAME} PUBLIC Qt${myx_qt_ver}::${iter})
endif() endif()
endif() endif()
endforeach() endforeach()
@ -70,7 +76,7 @@ function(myx_target_setup_qt TARGET_NAME)
endif() endif()
if(ARG_UI) if(ARG_UI)
if(NOT COMMAND qt${myx_ver_qt}qt_wrap_ui) if(NOT COMMAND qt${myx_ver_qt}_wrap_ui)
message(WARNING "MyxCMake: Widgets is required to process UI") message(WARNING "MyxCMake: Widgets is required to process UI")
else() else()
if(myx_qt_ver EQUAL 5) if(myx_qt_ver EQUAL 5)
@ -80,6 +86,8 @@ function(myx_target_setup_qt TARGET_NAME)
endif() endif()
set_property(TARGET ${TARGET_NAME} APPEND PROPERTY TR_FILES ${ARG_UI}) set_property(TARGET ${TARGET_NAME} APPEND PROPERTY TR_FILES ${ARG_UI})
target_link_libraries(${TARGET_NAME} PRIVATE Qt${myx_qt_ver}::Widgets) target_link_libraries(${TARGET_NAME} PRIVATE Qt${myx_qt_ver}::Widgets)
# TODO
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_BINARY_DIR})
endif() endif()
endif() endif()