qt5base-lts/examples/widgets/painting/shared/use_lib.cmake
Joerg Bornemann db25a067b0 Fix build of standalone painting examples
Since commit f5c69a5195 the examples/widgets/painting examples could
not be built standalone anymore.
Move the find_package calls out of the examples/widgets/painting/shared
subdirectory and add a .cmake file that can be included to use the
library conveniently.

Change-Id: I35cb5bd8419a67c782d109104c4a88d64477a8be
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-17 17:14:10 +02:00

14 lines
439 B
CMake

# Include this file in your example project to use the library defined in this directory.
# This avoids find_package calls in a directory scope different from the directory scope of the
# consuming target.
if(NOT TARGET Qt::Widgets)
find_package(Qt6 REQUIRED COMPONENTS Widgets)
endif()
if(NOT TARGET Qt::OpenGL)
find_package(Qt6 OPTIONAL_COMPONENTS OpenGL)
endif()
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}" painting_shared)