Bug report #7289

Add JOM CMake option to enable building with Qt JOM

Added by Nathan Woodrow over 11 years ago. Updated over 11 years ago.

Status:Closed
Priority:Normal
Assignee:Larry Shaffer
Category:Build/Install
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

Description

Don't set

ADD_DEFINITIONS( /W4 )
ADD_DEFINITIONS( /FR )

if JOM is enabled as it causes issues building

qgis-qtc-cmake-gui.bat (624 Bytes) Larry Shaffer, 2013-03-11 12:35 PM

qbrowser-qtc-build-start.bat (307 Bytes) Larry Shaffer, 2013-03-11 12:35 PM

qbrowser-qtc-install-start.bat (329 Bytes) Larry Shaffer, 2013-03-11 12:35 PM

qgis-build-shell.bat (764 Bytes) Larry Shaffer, 2013-03-11 12:35 PM

qtc-cmake-options.txt Magnifier (263 Bytes) Larry Shaffer, 2013-03-11 12:35 PM

qgis-qtc-start.bat (626 Bytes) Larry Shaffer, 2013-03-11 12:35 PM

qgis-qtc-build-start.bat (295 Bytes) Larry Shaffer, 2013-03-11 12:35 PM

qgis-qtc-install-start.bat (317 Bytes) Larry Shaffer, 2013-03-11 12:35 PM

History

#1 Updated by Larry Shaffer over 11 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

or directly (maybe): http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso

Will add more about the QtCreator and .batch file configurations in followup post.

#2 Updated by Larry Shaffer over 11 years ago

So here are my results/notes so far for setting up Qt Creator and NMake with jom:

The following differs from current INSTALL notes:

  • Microsoft Platform SDK for Windows Server 2003 R2 install 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~1 or 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: C:/Users/me/QGIS/QGIS_Apps-Qtc

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

Once built and installed, I use the following to launch QGIS from build dir and install dir, respectively: qgis-qtc-build-start.bat and qgis-qtc-install-start.bat

And similarly for the qbrowser application: qbrowser-qtc-build-start.bat and qbrowser-qtc-install-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

#3 Updated by Nathan Woodrow over 11 years ago

  • Resolution set to fixed
  • Status changed from In Progress to Closed

Also available in: Atom PDF