How to config QChart in cmake for using in qml
-
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 :- sudo apt-get install -y libqt5charts5-dev
- 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. -
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 :- sudo apt-get install -y libqt5charts5-dev
- 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.@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()
-
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 :- sudo apt-get install -y libqt5charts5-dev
- 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.@nasimChildOfDesert
do the following to avoid this type of error.
target_link_libraries( ${PROJECT_NAME} PRIVATE Qt5::Charts)