Bug report #7289
Add JOM CMake option to enable building with Qt JOM
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Windows||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||16298|
ADD_DEFINITIONS( /W4 )
ADD_DEFINITIONS( /FR )
if JOM is enabled as it causes issues building
#1 Updated by Larry Shaffer over 8 years ago
- Status changed from Open to In Progress
Working setup: https://github.com/qgis/Quantum-GIS/pull/464
Tested on two different Win 7 VMs, with no errors.
The errors with qgis_help and qbrowser were fixed by updating Visual Studio Express to SP1:
Get MS VS2008 w/ SP1 iso here (~750 MB): http://search.msdn.microsoft.com/search/en-US/default.aspx?query=visual%20studio%20express%202008%20download&refinement=111&ac=4
Will add more about the QtCreator and .batch file configurations in followup post.
#2 Updated by Larry Shaffer over 8 years ago
- File qgis-qtc-install-start.bat added
- File qgis-qtc-build-start.bat added
- File qgis-qtc-start.bat added
- File qtc-cmake-options.txt added
- File qbrowser-qtc-build-start.bat added
- File qgis-qtc-cmake-gui.bat added
- File qgis-build-shell.bat added
- File qbrowser-qtc-install-start.bat added
So here are my results/notes so far for setting up Qt Creator and NMake with jom:
- Windows 7 Home 64-bit
- 4 GB RAM
- 6 CPUs
- Two different Parallels 7 virtual machines (running under Mac OS X 10.7.5)
- Visual Studio Express with SP1 (as noted above)
- Windows 7 SDK for debugging in QtCreator
The following differs from current INSTALL notes:
Microsoft Platform SDK for Windows Server 2003 R2install doesn't appear to be necessary (at least I couldn't find any CMake options that utilized anything from that install). SetupAPI appears to be useable from:
C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/SetupAPI.Lib, though I can't say I know what it is used for exactly.
- I installed the GNU tools, flex and bison, in C:/GnuWin32. Using
Progra~2(for 64bit) still produced path-with-spaces problems for the tools.
- The general shell environment batch file setup I used (though I don't use this shell env anymore once QtCreator was setup): qgis-build-shell.bat
I used a separate virtual hard drive for source files and build directory at Q:\\Quantum-GIS and Q:\\build-qtc. There seemed to be an issue with having only the build directory being on a separate HDD, which was mitigated when I placed the source files there as well. The installed app goes into my home folder:
The INSTALL notes should include the info about generally creating a CMake project, like opening the top-level CMakeLists.txt and inputting default options.
Since Qt Creator works better when passing in CMake options via options dialog (rather than using CMake-GUI, etc), I keep a text file handy with the default options I pass in, for initial project setup and for whenever Creator randomly asks for them. (These are just my choices for initial options): qtc-cmake-options.txt
The project build steps are as follows (-j option may be unnecessary unless you want jom to NOT automatically use all of your available CPU cores):
jom.exe -j6 jom.exe -j6 staged-plugins (optional, unless running from build dir) jom.exe -j6 install (optional)
For launching Creator I use the following batch file: qgis-qtc-start.bat
For running CMake-GUI (if needed): qgis-qtc-cmake-gui.bat
It is best to run CMake-GUI while Creator is open, otherwise, you may be prompted with the default CMake options dialog on Qt Creator launch after using CMake-GUI. Likewise, any changes done with CMake-GUI will be reverted if they are not reflected in future inputted options to Qt Creator's CMake options dialog. Generally, I avoid using CMake-GUI to change CMakeCache.txt when using Qt Creator, and only use it to browse current settings.
For debugging, I installed Windows 7 SDK (just Developer Tools) and set the path to CDB debugger manually in
Options->Build-n-Run->Kits->Desktop (it was not auto-detected by Qt Creator):
C:\\Program Files\\Debugging Tools for Windows (x64)\\cdb.exe