2
votes

Qt Creator + VC19 (MSVC2015) + WinSDK8.1 No Qt itself used. Just console application std+boost+catch+easyloggingpp

VC\bin and WinSDK\bin both are in a system path variable. all includes and lib paths configured in a pro file.

I need to move them out from project file to build this project on various machines (all windows but different locations of the used libraries).

I think that cl.exe can read this from LIB and INCLUDE env variables, but if I do this (set headers and libraries paths from bat file or in a project settings in QT Creator) it doesn't work, QtC reports me that can't find some headers. Could you clarify for me:

  1. Should Qt Creator read LIB and INCLUDE variables for the build and parsing? What is right steps to make it working?
  2. If Qt Creator can't read the env variables , then what is right way to remove the dependency of absolute paths in project build with qmake?
1
Beware the following qmake behavior (witnessed on Linux, not sure if it happens in Windows): qmake parses environment variables and then writes the values into the makefiles it generates. So, once you create makefiles, if you change an environment variable, you must make qmake re-generate the makefiles to update them.Steve

1 Answers

1
votes

You obviously have Visual Studio compiler and other standard library paths hardcoded as absolute in your project file?

All the Visual Studio or other compiler settings e.g. tool chain location are normally read by Qt Creator from compiler kit. Adding Compilers article clarifies on that. That is the first thing to configure as long as your system has Visual Studio installed. Having configured compiler kit you will be able to add one to your current project build: Configuring Projects article.

And in case if you build from command line with qmake and jom: your build script may execute the Visual Studio standard environment batch script file like:

"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\VcVarsAll.bat" amd64

Mind the target bitness (32/64) and actual location of your Visual Studio. There is MSDN article for that: Setting the Path and Environment Variables for Command-Line Builds.