Answering my own question, but I followed this tutorial to get cross-compilation of qt4 applicatins working outside qtcreator:

hertaville.com/2014/04/12/cross-compiling-qt4-app/

Then, instead of using the Makefile in that tutorial, I copied a mkspecs directory and edited its qmake.conf for the same configuration options:

Qt Code:
  1. #
  2. # qmake configuration for linux-arm-g++
  3. #
  4.  
  5. CROSS_COMPILE = arm-linux-gnueabihf
  6. ROOTFS = /home/davethomaspilot/rpi/mntrpi
  7. MAKEFILE_GENERATOR = UNIX
  8. TARGET_PLATFORM = unix
  9. TEMPLATE = app
  10. CONFIG += qt warn_on release incremental link_prl gdb_dwarf_$
  11. QT += core gui
  12. QMAKE_INCREMENTAL_STYLE = sublib
  13.  
  14. include(../common/linux.conf)
  15. include(../common/gcc-base-unix.conf)
  16. include(../common/g++-unix.conf)
  17. QMAKE_CXX = $$CROSS_COMPILE-g++
  18. QMAKE_LINK = $$CROSS_COMPILE-g++
  19. QMAKE_LINK_SHLIB = $$CROSS_COMPILE-g++
  20. QMAKE_AR = $$CROSS_COMPILE-ar cr
  21. QMAKE_OBJCOPY = $$CROSS_COMPILE-objcopy
  22. QMAKE_STRIP = $$CROSS_COMPILE-strip
  23. QMAKE_LFLAGS_RELEASE = -Wl,-O1
  24. QMAKE_RPATHDIR += $$ROOTFS/lib/arm-linux-gnueabihf
  25. QMAKE_RPATHDIR += $$ROOTFS/usr/lib/arm-linux-gnueabihf
  26. QMAKE_INCDIR = $$ROOTFS/usr/include
  27. QMAKE_INCDIR_QT = $$ROOTFS/usr/include/qt4
  28. QMAKE_RPATHDIR = $$ROOTFS/lib/arm-linux-gnueabihf
  29. QMAKE_RPATHDIR += $$ROOTFS/usr/lib/arm-linux-gnueabihf
  30. QMAKE_LIBDIR = $$ROOTFS/usr/lib
  31. QMAKE_LIBDIR_QT = $$ROOTFS/usr/lib/arm-linux-gnueabihf
  32. QMAKE_LIBDIR_QT += $$ROOTFS/lib/arm-linux-gnueabihf
  33. QMAKE_INCDIR_X11 = $$ROOTFS/usr/include
  34. QMAKE_LIBDIR_X11 = $$ROOTFS/usr/lib/arm-linux-gnueabihf
  35. QMAKE_LIBDIR_X11 += $$ROOTFS/lib/arm-linux-gnueabihf
  36. QMAKE_INCDIR_OPENGL = $$ROOTFS/usr/include
  37. QMAKE_LIBDIR_OPENGL = $$ROOTFS/usr/lib
  38.  
  39. load(qt_config)
To copy to clipboard, switch view to plain text mode 

Then, as Wysota suggested in another thread, I used the -spec qmake option to specify the new "linux-arm-g++" mkspec.

Works great and now I get fast compile times, less than a minute on my W520 laptop versus over 10 minutes using native compile on the rpi.