Hey guys, i'm trying to use QCustomPlot as shared library via cmake using the following CMakeLists:

qcustomplot lib CMakeLists.txt:

cmake_minimum_required(VERSION 3.20)

project(qcustomplot LANGUAGES CXX)

find_package(Qt6 COMPONENTS Widgets PrintSupport REQUIRED)

add_library(qcustomplot SHARED)
target_compile_definitions(qcustomplot PRIVATE QCUSTOMPLOT_COMPILE_LIBRARY)
target_include_directories(qcustomplot PUBLIC ${CMAKE_CURRENT_LIST_DIR})
target_sources(qcustomplot PRIVATE ${CMAKE_CURRENT_LIST_DIR}/qcustomplot.cpp)
target_link_libraries(qcustomplot PUBLIC Qt6::Core Qt6::Gui Qt6::Widgets Qt6::PrintSupport)

main project CMakelists.txt

cmake_minimum_required(VERSION 3.20)

project(app LANGUAGES CXX)

find_package(Qt6 COMPONENTS Widgets REQUIRED)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/qcustomplot) # here adding qcustomplot subfolder

# setting up sources, qt settings etc...

add_executable(app WIN32 ${PROJECT_SOURCES})
add_dependencies(app qcustomplot)
target_compile_definitions(app PRIVATE QCUSTOMPLOT_USE_LIBRARY)
target_link_libraries(app PRIVATE Qt6::Widgets qcustomplot)

So, the problem is that I am using the windeployqt for the final build of the application, but when it starts, it doesn't see the PrintSupport dependency from the qcustomplot subdirectory(as far as I understand, the PUBLIC specifier in target_link_libraries(qcustomplot PUBLIC Qt6::PrintSupport) should add the PrintSupport dependency to the main application, but it doesn't).

Moreover, if I explicitly add PrintSupport to main application, it still won't work:

find_package(Qt6 COMPONENTS Widgets PrintSuppot REQUIRED)
# ...
target_link_libraries(app PRIVATE Qt6::Widgets Qt6::PrintSuppot qcustomplot)

I would be grateful for your help.