Results 1 to 16 of 16

Thread: Qwt with CMake

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,331
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qwt with CMake

    Instead of using the CUSTOM_LIBRARY_PATH or CMAKE_PREFIX_PATH, you should probably use the find_library() command, something like this:

    Qt Code:
    1. find_library( QWT NAMES qwt qwt6 PATHS /usr/local/qwt-6.2.0/lib REQUIRED )
    2.  
    3. 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)
    Last edited by d_stranz; 2nd March 2023 at 20:42.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Qt Creator Qt SDK 1.1.3 and CMake on Mac OS X 10.7.1 / Lion
    By agarny in forum Qt Tools
    Replies: 2
    Last Post: 3rd August 2012, 08:56
  2. Cmake
    By R.CH in forum Qt Programming
    Replies: 1
    Last Post: 7th October 2010, 17:06
  3. QT linguist Cmake
    By _Jack_ in forum Qt Programming
    Replies: 1
    Last Post: 18th September 2010, 11:29
  4. using moc with cmake
    By Isaac in forum Newbie
    Replies: 2
    Last Post: 29th May 2008, 03:10
  5. CMake and pthreads
    By Matt Smith in forum General Discussion
    Replies: 5
    Last Post: 3rd September 2006, 20:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.