Instead of using the CUSTOM_LIBRARY_PATH or CMAKE_PREFIX_PATH, you should probably use the find_library() command, something like this:
Qt Code:
find_library( QWT NAMES qwt qwt6 PATHS /usr/local/qwt-6.2.0/lib REQUIRED ) target_link_libraries( plottapp Qt6::Widgets Qt6::Charts ${QWT} )To copy to clipboard, switch view to plain text mode
However, your problem all along could be that the library might not be named "qwt" but "qwt6"
In any case, find_library() is a better solution than changing CMake variables, which could have unintended consequences.
With Microsoft compilers, the order of libraries does not matter. In linux and gcc, the libraries might have to be listed in dependency order, i.e. (plottapp ${QWT} Qt6::Charts Qt6::Widgets)
Bookmarks