district10 / cmake-templates

Some CMake Templates (examples). Qt, Boost, OpenCV, C++11, etc 一些栗子
http://blog.tangzhixiong.com/post-0100-cmake-templates.html
MIT License
530 stars 140 forks source link

HOWTO: Qt4 & VS2015 #6

Open district10 opened 8 years ago

district10 commented 8 years ago

Qt4 doesn't provide an official vs2015 prebuild, and you can't easily compile one yourself.

But it is possible. See http://whudoc.qiniudn.com/2016/vs2015-qt4-playground.zip (14 MB).

14 MB = 13.6 MB of qt4 prebuild (release version only, a tiny qt4!) + 1 demo qt project.

The README.txt inside is written in chinese, steps are:

  1. unzip qt4-vs2015x64.7z in current dir;
  2. open CMD: hold Shift, right click, then hit w, Enter;
  3. set environment varible: type in CMD "set PATH=%CD%\qt4-vs2015x64\bin;%PATH%"; (better add this path to %PATH%, it's needed at runtime too.)
  4. open cmake-gui: type in CMD "cmake-gui demo";
  5. build vs2015 project: 1) set build dir; 2) set compilation option to VS2015 WIN64; 3) configure, build;
  6. use vs2015 to open .sln file in build dir, build the release version (not debug!).

You should be able to build & run this qt4 project inside VS2015.

See more at qt4-vs2015x64/README.md at master · district10/qt4-vs2015x64.