Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to config QChart in cmake for using in qml
Qt 6.11 is out! See what's new in the release blog

How to config QChart in cmake for using in qml

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 731 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nasimChildOfDesert
    wrote on last edited by
    #1

    Re: How to configure QtCharts withint CMakelist.txt

    I want to draw chart in qml , in ubunto How do I config cmake?
    I do this :

    1. sudo apt-get install -y libqt5charts5-dev
    2. i add this line in cmake:
      find_package(Qt5 COMPONENTS Charts REQUIRED)
      target_link_libraries(my_target PRIVATE Qt5::Charts)

    this error :
    error: Cannot specify link libraries for target "my_target" which is not built by this project.
    :-1: error: CMake process exited with exit code 1.

    Christian EhrlicherC JoeCFDJ 2 Replies Last reply
    0
    • N nasimChildOfDesert

      Re: How to configure QtCharts withint CMakelist.txt

      I want to draw chart in qml , in ubunto How do I config cmake?
      I do this :

      1. sudo apt-get install -y libqt5charts5-dev
      2. i add this line in cmake:
        find_package(Qt5 COMPONENTS Charts REQUIRED)
        target_link_libraries(my_target PRIVATE Qt5::Charts)

      this error :
      error: Cannot specify link libraries for target "my_target" which is not built by this project.
      :-1: error: CMake process exited with exit code 1.

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @nasimChildOfDesert said in How to config QChart in cmake for using in qml:

      error: Cannot specify link libraries for target "my_target" which is not built by this project.

      Isn't this obvious enough? There is no target named 'my_target' - you did not create such a target with add_exeuctable() or add_library()

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • N nasimChildOfDesert

        Re: How to configure QtCharts withint CMakelist.txt

        I want to draw chart in qml , in ubunto How do I config cmake?
        I do this :

        1. sudo apt-get install -y libqt5charts5-dev
        2. i add this line in cmake:
          find_package(Qt5 COMPONENTS Charts REQUIRED)
          target_link_libraries(my_target PRIVATE Qt5::Charts)

        this error :
        error: Cannot specify link libraries for target "my_target" which is not built by this project.
        :-1: error: CMake process exited with exit code 1.

        JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by
        #3

        @nasimChildOfDesert
        do the following to avoid this type of error.
        target_link_libraries( ${PROJECT_NAME} PRIVATE Qt5::Charts)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved