Pushing external libraries used in GIT
-
I am using openCV library in my QT project.
While developing the project I did use openCV by using few paths in my local as mentioned here : https://www.learnopencv.com/configuring-qt-for-opencv-on-osx/
But now I have to push my code in GIT, so what should I do so that the other person pulling the project gets openCV?
-
- push the code along with your code, or
- go the dynamic approach and let the user configure OpenCV themselves, or
- add the OpenCV git repo as a sub-module to your repository
[edit: fixed small typo: yourself -> themselves SGaist]
-
@raven-worx Thanks for the reply. So there is no project management in QT?
Also, in many thread people have said that while pushing we should add our project.pro
file in.gitignore
. But if we are not pushing the.pro
file then how will the other person run the project when it pulls? -
The person downloading your code should go along the same path - use pkg-config to set up OpenCV on their side.
You can bundle OpenCV with your code, but storing binaries in GIT is not really a good idea. And you would have to store separate lib for all systems and build architectures.
-
@Arqam said in Pushing external libraries used in GIT:
Also, in many thread people have said that while pushing we should add our project .pro file in .gitignore
this is non-sense. Of course you should also commit your .pro file.
You should just make sure not to use any hardcoded/absolute paths in it. -
@Arqam said in Pushing external libraries used in GIT:
Also, in many thread people have said that while pushing we should add our project .pro file in .gitignore
.pro file is fine and necessary - push it.
.pro.user file is not fine - it is a local config file, auto-generated by Qt Creator for your session. Do not push that to GIT, it won't work on other PCs than yours.
-
@Arqam
you can take this as a reference for a Qt based .gitignore