--- qsampler/trunk/CMakeLists.txt 2021/03/30 23:31:09 3868 +++ qsampler/trunk/CMakeLists.txt 2021/04/01 21:49:01 3869 @@ -69,14 +69,24 @@ option (CONFIG_STACKTRACE "Enable debugger stack-trace (default=no)" 0) +# Enable Qt6 build preference. +option (CONFIG_QT6 "Enable Qt6 build (default=no)" 0) + + # Fix for new CMAKE_REQUIRED_LIBRARIES policy. if (POLICY CMP0075) cmake_policy (SET CMP0075 NEW) endif () # Check for Qt... -find_package (Qt6 QUIET) -if (Qt6_FOUND) +if (CONFIG_QT6) + find_package (Qt6 QUIET) + if (NOT Qt6_FOUND) + set (CONFIG_QT6 0) + endif () +endif () + +if (CONFIG_QT6) find_package (QT QUIET NAMES Qt6) else () find_package (QT QUIET NAMES Qt5)