From ed531c24dd8adc3b6eb57f8eb0e51dcc3002d315 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sun, 30 Jul 2023 14:29:25 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MyxCMake/lib/AddInterfaceLibrary.cmake | 6 +++++- MyxCMake/lib/macro/QTest.cmake | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/MyxCMake/lib/AddInterfaceLibrary.cmake b/MyxCMake/lib/AddInterfaceLibrary.cmake index 106e5a5..f8eedd3 100644 --- a/MyxCMake/lib/AddInterfaceLibrary.cmake +++ b/MyxCMake/lib/AddInterfaceLibrary.cmake @@ -50,6 +50,7 @@ function(myx_add_interface_library TARGET_NAME) add_library(${TARGET_NAME} INTERFACE ${ARG_HEADERS}) endif() + foreach(__iter ${ARG_PACKAGES}) target_include_directories(${TARGET_NAME} INTERFACE ${${__iter}_INCLUDE_DIRS}) target_compile_definitions(${TARGET_NAME} INTERFACE ${${__iter}_COMPILE_DEFINITIONS}) @@ -71,7 +72,10 @@ function(myx_add_interface_library TARGET_NAME) # Библиотека, состоящая только из заголовочных файлов не требует сборки. # Стандартные пути к заголовочным файлам - target_include_directories(${TARGET_NAME} INTERFACE $) + target_include_directories(${TARGET_NAME} INTERFACE + $ + $ + ) # Если вызов был выполнен не из проекта верхнего уровня, # то созданная цель исключается из цели `all`. diff --git a/MyxCMake/lib/macro/QTest.cmake b/MyxCMake/lib/macro/QTest.cmake index f77cf04..be0dbb6 100644 --- a/MyxCMake/lib/macro/QTest.cmake +++ b/MyxCMake/lib/macro/QTest.cmake @@ -21,7 +21,7 @@ macro(myx_add_qtest TARGET_NAME) endforeach() add_executable(${TARGET_NAME} ${mocs} ${cpps} ${hpps}) - target_link_libraries(${TARGET_NAME} Qt5::Core Qt5::Test) + target_link_libraries(${TARGET_NAME} PRIVATE Qt5::Core Qt5::Test) add_test(NAME ${TARGET_NAME} COMMAND ${TARGET_NAME})