Home > Software design >  Feature clock_monotonic is already defined to be "OFF" and should now be set to "ON&q
Feature clock_monotonic is already defined to be "OFF" and should now be set to "ON&q

Time:08-24

I tried to run my project that I did 2 months ago and get this error. I suppose that's because of new version or something like that but I do not know what to do. The error itself:

/opt/homebrew/lib/cmake/Qt6/QtFeature.cmake:1249: error: Feature clock_monotonic is already defined to be "OFF" and should now be set to "ON" when importing features from Qt6::Core.
/opt/homebrew/lib/cmake/Qt6Core/Qt6CoreConfig.cmake:118 (qt_make_features_available)
/Users/me/Qt/Tools/CMake/CMake.app/Contents/share/cmake-3.21/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/homebrew/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:14 (find_dependency)
/opt/homebrew/lib/cmake/Qt6Widgets/Qt6WidgetsDependencies.cmake:96
(_qt_internal_find_dependencies)
/opt/homebrew/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake:40 (include) /opt/homebrew/lib/cmake/Qt6/Qt6Config.cmake:213 (find_package)
CMakeLists.txt:14 (find_package)

CodePudding user response:

It's a not-uncommon issue in CMake where values are cached, but then updating libraries does not update the values as expected.

If you delete CMakeCache.txt in your build folder and reconfigure (call cmake / qt-cmake with your initial options again) then it will go away.

  • Related