diff --git a/MyxCMakeConfigVersion.cmake b/MyxCMakeConfigVersion.cmake index 4f6e4a7..6424a67 100644 --- a/MyxCMakeConfigVersion.cmake +++ b/MyxCMakeConfigVersion.cmake @@ -1,4 +1,4 @@ -set(MYX_CMAKE_PACKAGE_VERSION "1.99.71") +set(MYX_CMAKE_PACKAGE_VERSION "1.99.72") if(MYX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() diff --git a/README.md b/README.md index 37316f0..19918da 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,10 @@ if(MYX_CMAKE_DIR) set(ENV{MYX_CMAKE_DIR} ${MYX_CMAKE_DIR}) endif() if(DEFINED ENV{MYX_CMAKE_DIR}) - find_package(MyxCMake 1.99.71 REQUIRED) + find_package(MyxCMake 1.99.72 REQUIRED) else() if(MYX_CMAKE_USE_SYSTEM) - find_package(MyxCMake 1.99.71 REQUIRED) + find_package(MyxCMake 1.99.72 REQUIRED) else() include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake) endif() diff --git a/VERSION b/VERSION index 2008603..b6c0d05 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.99.71 +1.99.72 diff --git a/lib/Qt5TargetSetup.cmake b/lib/Qt5TargetSetup.cmake index 15617d5..15a01c8 100644 --- a/lib/Qt5TargetSetup.cmake +++ b/lib/Qt5TargetSetup.cmake @@ -10,14 +10,22 @@ function(myx_qt5_target_setup NAME) get_target_property(type ${NAME} TYPE) foreach(iter ${ARG_COMPONENTS}) - target_include_directories(${NAME} PRIVATE ${Qt5${iter}_INCLUDE_DIRS}) + if(type STREQUAL "INTERFACE_LIBRARY") + target_include_directories(${NAME} INTERFACE ${Qt5${iter}_INCLUDE_DIRS}) + else() + target_include_directories(${NAME} PRIVATE ${Qt5${iter}_INCLUDE_DIRS}) + endif() if(type STREQUAL "EXECUTABLE" AND NOT iter STREQUAL "LinguistTools") target_link_libraries(${NAME} PRIVATE "Qt5::${iter}") endif() endforeach() foreach(iter ${ARG_PRIVATE}) - target_include_directories(${NAME} PRIVATE ${Qt5${iter}_PRIVATE_INCLUDE_DIRS}) + if(type STREQUAL "INTERFACE_LIBRARY") + target_include_directories(${NAME} INTERFACE ${Qt5${iter}_PRIVATE_INCLUDE_DIRS}) + else() + target_include_directories(${NAME} PRIVATE ${Qt5${iter}_PRIVATE_INCLUDE_DIRS}) + endif() endforeach() if(type STREQUAL "EXECUTABLE") diff --git a/lib/TargetSetup.cmake b/lib/TargetSetup.cmake index af38db6..48541f0 100644 --- a/lib/TargetSetup.cmake +++ b/lib/TargetSetup.cmake @@ -4,7 +4,7 @@ function(myx_target_setup NAME) set(options) set(oneValueArgs PCH) set(multiValueArgs COMPILE_DEFINITIONS PACKAGES LINK_LIBRARIES - CPP PUBLIC_HEADERS PRIVATE_HEADERS) + CPP INTERFACE_HEADERS PUBLIC_HEADERS PRIVATE_HEADERS) cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -48,15 +48,17 @@ function(myx_target_setup NAME) file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/include") endif() - target_include_directories(${PROJECT_NAME} PRIVATE - $) - - if(IS_DIRECTORY "${PROJECT_SOURCE_DIR}/src") + if(NOT type STREQUAL "INTERFACE_LIBRARY") target_include_directories(${PROJECT_NAME} PRIVATE - $) + $) + + if(IS_DIRECTORY "${PROJECT_SOURCE_DIR}/src") + target_include_directories(${PROJECT_NAME} PRIVATE + $) + endif() endif() - if(type STREQUAL EXECUTABLE) + if(type STREQUAL "EXECUTABLE") if(IS_DIRECTORY "${PROJECT_SOURCE_DIR}/include") target_include_directories(${PROJECT_NAME} PRIVATE $) @@ -72,6 +74,7 @@ function(myx_target_setup NAME) install(TARGETS ${NAME} COMPONENT main RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() + target_sources(${NAME} INTERFACE $) target_sources(${NAME} PUBLIC ${ARG_PUBLIC_HEADERS}) target_sources(${NAME} PRIVATE ${ARG_CPP} ${ARG_PCH} ${ARG_PRIVATE_HEADERS}) target_link_libraries(${NAME} PRIVATE ${ARG_LINK_LIBRARIES}) @@ -80,7 +83,7 @@ function(myx_target_setup NAME) # Установка публичных заголовочных файлов if(PROJECT_IS_TOP_LEVEL) install_relative(${PROJECT_SOURCE_DIR} - FILES ${ARG_PUBLIC_HEADERS} + FILES ${ARG_PUBLIC_HEADERS} ${ARG_INTERFACE_HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT dev )