0

I'm about to switch from CruiseControl.NET to Jenkins.

My problem with the build process is the error "QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." I have already tried several solutions but without success. Changing the build methods (NAnt/MSBuild) also produces the same error message. In Visual Studio under Project Properties (C/C++ > Additional Include Directories) I noticed that QTDIR is not known although it exists as an environment variable (as an example instead of {QTDIR}\include I only get \include).

I am using: Qt 5.9.0, MS Visual Studio 2015, Qt Visual Studio Tools (V2.3.2)

In the past I have tried on using an older version of the Visual Studio Tools plugin how the developers recommend. I also checked the paths and set environments variables. Giving Jenkins the path "C:\Users\user\AppData\Local\QtMsBuild" as parameter does not changed anything.

I do not want to copy the files from "C:\Users\user\AppData\Local\QtMsBuild" into each build directory, because at ccnet it's working.

How can I solve this problem?

Konstantin
  • 11
  • 7
  • Hi, have you checked [this thread](https://stackoverflow.com/questions/51082148/compiling-qt-projects-in-qt-msbuild-format-without-qt-vs-tools-installed). And if you build the project within VS, it succeeds? After that, use the developer command prompt, what's the result? – LoLance Apr 09 '19 at 04:37
  • Hi thanks for your comment. The build process in VS is successfull. I added QTDIR and QtMsBuild as properties in Jenkins and extended the NAnt script with a block. This solved the problem. – Konstantin Apr 09 '19 at 06:23
  • Glad to know your issue has been solved and thanks for sharing your solution! You can add it as answer and mark it! Have a nice day:) – LoLance Apr 09 '19 at 06:26

1 Answers1

1

For me this solutions works:

  1. add QTDIR and QtMsBuild at the NAnt build process as properties in Jenkins

Example:

QtMsBuild=C:\\Users\\user\\AppData\\Local\\QtMsBuild
QTDIR=D:\\Qt 5.9.0\\qtbase
  1. extend the NAnt script with a <setenv> block

Example:

<setenv>
      <variable name="qtdir" value="${QTDIR}" />
      <variable name="qtmsbuild" value="${QtMsBuild}" />
</setenv>
Konstantin
  • 11
  • 7