简体   繁体   中英

how to get Qt 5.4.0 source that works for BOTH Windows and OS X

I need to get Qt 5.4.0 source, make a few changes, then build it on both Windows and Mac OS X (including qtwebkit).

If I download the .zip file, I can build on Windows, but configure won't run on Mac - it doesn't like the line endings, apparently. If I copy configure and qtbase/configure (which are missing from the .zip) from a .tar.gz Qt5 download, configure gives me a "You don't seem to have 'make' or 'gmake' in your PATH" error.

If I download the .tar.gz file, I can build on Mac, but it's missing configure.bat (and who knows what else), so I can't build on Windows.

If I use git to get the source, I end up with the source of the latest dev branch I think. I need the source of the actual 5.4.0 release. I'm no git expert, so even if I could live with the source on the dev branch, I've never successfully managed to build it.

EDIT: I did manage to get Qt 5.4.0 via git and successfully run perl init-repository . However, when I copy that source to Windows and try to run configure , it complains about missing qtbase\\configure.exe. If I copy configure.exe from the .zip version of Qt 5.4.0, configure fails with C:\\qt\\qt5_git\\qtbase\\src\\corelib\\global\\qglobal.h(68) : fatal error C1083: Cannot open include file: 'QtCore/qsystemdetection.h': No such file or directory . Of course, the qsystemdetection.h does exist in the same folder as qglobal.h.

If I use git to get Qt 5.4.0 on Windows and run perl init-repository , that works fine on Windows. But copying to OS X yields the same problem as using the .zip file, described above.

There must be some way to do this! When Qt's whole reason for existence is for cross-platform development, it's just too ironic that Qt5 requires me to maintain 2 separate code bases (one for Windows, one for OS X) just to be able to build it.

So what am I missing? How do I get a copy of Qt 5.4.0 that I can modify slightly, then build on both Windows and OS X?

Thanks to some help on the Qt forum , here's what I did that worked:

  1. Download the Qt 5.4.1 .tar.gz on Windows 7.
  2. Unzip with 7zip. Both configure.bat's were included! However, qtbase\\configure.exe did not get built when configuring. Seems that only happens when I get the source via git.
  3. Download the Q 5.4.1 .zip. Turns out, the .zip includes qtbase\\configure.exe!
  4. Copy the configure.exe from the .zip and paste it into the source from the .tar.gz.
  5. Make my edits to the .tar.gz source.
  6. Use 7zip to create a new .tar.gz of the source, with my edits. I have copied that new .tar.gz to Windows 7 and OS X Yosemite build machines, and it configures and builds on both, including building qtwebkit.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM