Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake build system installs targets differently from Qmake and arguably wrongly #1

Open
barracuda156 opened this issue Aug 27, 2023 · 4 comments

Comments

@barracuda156
Copy link

CMake uses repo name qt4-mimetypes for libs and directories, which introduces difficulties for other projects to find needed files. Qmake installs everything with standard names, like QtMimeTypes etc.
Not sure if this was intended or a bug.

@d1vanov
Copy link
Owner

d1vanov commented Aug 27, 2023

Hi there.
It's been many years since I used this project and repo myself and I don't quite remember all the details about about its CMakeLists.txt. What I recall is that while I had been using this project it worked fine for me. If another project uses cmake as well it should be able to use find_package(qt4-mimetypes) to find the installed files. You just need to feed cmake with the path to the cmake dir within the installation prefix like this: -Dqt4-mimetypes_DIR=<...>.

If you have particular ideas about what should be changed in CMakeLists.txt to make things better, feel free to open a PR. Or you can just fork this project and modify things as you see fit. I don't use this project myself anymore so I don't intend to invest too much into its support.

@barracuda156
Copy link
Author

@d1vanov I was building a legacy version of libqtxdg, it asked for QtMimeTypes which I did not have, I began looking for it and eventually found this repo. I started with CMake since I am more familiar with it than Qt own build system, but that failed (i.e. qt4-mimetypes built fine, but libqtxdg did not see it, despite also using CMake). Possibly I should have used alternative args to point to the installation. I have tried what CMake suggested, setting paths to includes and a dir where the library was installed into. Did not purse the issue any further, switched to Qmake, and everything worked fine then.

Maybe there was some credible reason at the time to use non-standard dirs and names, like having multiple co-existing versions? I will try you suggestion, maybe like that it gonna work with CMake as well.

@d1vanov
Copy link
Owner

d1vanov commented Aug 28, 2023

So I found a way to install the legacy Qt4 libs on my current system and built this repo. I think I see now what you mean by non-standard location: headers are installed into qt4-mimetypes directory. I wasn't able to build with qmake as it throws some "deprecated" errors but I assume qmake installs headers into QtMimeTypes directory - at least src/mimetypes/mimetypes.pro file seems to set things up to do that.

Well, when I converted the build of this project to cmake, I didn't try to match it with qmake build 1-to-1 so I just went with the directory qt4-mimetypes which was good enough for me, that's just it.

@barracuda156
Copy link
Author

barracuda156 commented Aug 29, 2023

@d1vanov Yes, that is correct. Also the library had non-standard name, I think, when installed with CMake.

By the way, looks like at least on macOS it builds fine with Qmake on all systems where Qt4 builds: https://ports.macports.org/port/qt4-mimetypes/details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants