advanced docking system - how can I implement it to a project
-
I want to use the "advanced docking system" from https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System. I opened the ads.pro file with QT and build it successfully. Now I have a build-folder with some sub-folders like "lib" (contains one .dll and .a file) and "src". The src folder includes a "debug" folder with a lot .o and .cpp files.
I'm using QT Creator on Windows 10.
I have no idea how to "include" the library to my cmake-project.
What do I need to add to my cmake file?best regards
-
Hi and welcome to devnet,
Did you take a look at the examples that comes with the repository ?
-
Hi!
According to the example I have added to my cmakefile:
target_link_libraries(ads_test PRIVATE qt${QT_VERSION_MAJOR}advanceddocking).
The cmakefile doesn't show a syntaxerror- but If I try to build it says: :-1: error: cannot find -lqt6advanceddocking.My main-confusion is: I have to include DockManager.h . The file DockManager.h is not available in the ads-build-folder. It is available in the "ads master folder", from where I build.
Do I need both folders (build and the master folder from git)? I would expect -> no.
-If no, how can QT find the DockManager.h file? Can QT find it somehow trough/in the libqtadvanceddocking.a -file or .o files in the build folder? How can I tell QT where to look for it? Do I need to add an environment variable? Which folder do I need to link?
-If yes, how can I add the link to the include folder in the cmakefile? With include_directories or target_include_directories(thisproject PRIVATE headerdir)?thanks!
-
Hi!
According to the example I have added to my cmakefile:
target_link_libraries(ads_test PRIVATE qt${QT_VERSION_MAJOR}advanceddocking).
The cmakefile doesn't show a syntaxerror- but If I try to build it says: :-1: error: cannot find -lqt6advanceddocking.My main-confusion is: I have to include DockManager.h . The file DockManager.h is not available in the ads-build-folder. It is available in the "ads master folder", from where I build.
Do I need both folders (build and the master folder from git)? I would expect -> no.
-If no, how can QT find the DockManager.h file? Can QT find it somehow trough/in the libqtadvanceddocking.a -file or .o files in the build folder? How can I tell QT where to look for it? Do I need to add an environment variable? Which folder do I need to link?
-If yes, how can I add the link to the include folder in the cmakefile? With include_directories or target_include_directories(thisproject PRIVATE headerdir)?thanks!
@Dabrzn said in advanced docking system - how can I implement it to a project:
My main-confusion is: I have to include DockManager.h . The file DockManager.h is not available in the ads-build-folder. It is available in the "ads master folder", from where I build.
You need to link the lib first and set the include directory.
In the example the include dir is set toCMAKE_CURRENT_SOURCE_DIR/../../src
.
If you look at the repo, insrc
there are all the headers you need. -
It is working:
cmakefile:
target_include_directories(ads_test PRIVATE C:/sandbox/qt_lib/Qt-Advanced-Docking-System-master/src)
target_link_libraries(ads_test PUBLIC Qt${QT_VERSION_MAJOR}::Widgets C:/sandbox/qt_lib/build-ads-Desktop_Qt_6_7_1_MinGW_64_bit-Debug/lib/libqtadvanceddocking.a)mainwindow.h:
#include <DockManager.h>In my case I need both: the build folder and the master folder(from git). Maybe there is a better way to implement that library...but for the beginning it is ok for me.
-
-
It is working:
cmakefile:
target_include_directories(ads_test PRIVATE C:/sandbox/qt_lib/Qt-Advanced-Docking-System-master/src)
target_link_libraries(ads_test PUBLIC Qt${QT_VERSION_MAJOR}::Widgets C:/sandbox/qt_lib/build-ads-Desktop_Qt_6_7_1_MinGW_64_bit-Debug/lib/libqtadvanceddocking.a)mainwindow.h:
#include <DockManager.h>In my case I need both: the build folder and the master folder(from git). Maybe there is a better way to implement that library...but for the beginning it is ok for me.
@Dabrzn said in advanced docking system - how can I implement it to a project:
C:/sandbox/qt_lib/Qt-Advanced-Docking-System-master/
C:/sandbox/qt_lib/build-ads-Desktop_Qt_6_7_1_MinGW_64_bit-Debug/lib/libqtadvanceddocking.a
Absolute paths are not the cleanest solution, but for trying and testing it's ok :)
Also, you are linking the library from the build directory... better install the lib to a different and persistent place on your computer and link it from there.
See:
and: