Bug 386776

Summary: using QtSDK doesn't work on Windows
Product: [Developer tools] Craft Reporter: Uwe Stöhr <uwestoehr>
Component: CoreAssignee: Hannah von Reth <vonreth>
Status: RESOLVED NOT A BUG    
Severity: normal CC: kde-windows, simonandric5
Priority: NOR    
Version: master   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:

Description Uwe Stöhr 2017-11-12 15:10:35 UTC
I set up Craft from scratch following the guidelines in
https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Windows

Since I have already Qt 5.9l.2 installed because I need it for other non-KDE project, I want to use the prebuild Qt libraries from this installation.

In my craftsettings.ini and have therefore now this:

[QtSDK]
## For advanced users only
## Whether to use prebuild Qt binaries.
Enabled = True
## The path to the Qt sdk.
Path = C:\Qt\Qt5.9.2\5.9.2\msvc2015_64\bin
## The version of Qt.
Version = 5.9.2
## The compiler version, if you are not sure what to use, have a look into the derectory set in QtSDK/Path.
## The compiler must be of the same type as General/KDECOMPILER.
## If you are using mingw please make sure you have installed the mingw using the Qt installer.
Compiler = msvc2015_64

But when I now use e.g. the command
craft karchive
I get this error:
  Could not find a package configuration file provided by "Qt5" (requested
  version 5.7.0) with any of the following names:

    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
  to a directory containing one of the above files.  If "Qt5" provides a
  separate development package or SDK, be sure it has been installed.

But in the path I specified:
C:\Qt\Qt5.9.2\5.9.2\msvc2015_64\bin
there is the Qt5Config.cmake

So either I made a mistake or setting the Qt doesn't work as it should.
Comment 1 Uwe Stöhr 2017-11-12 15:30:17 UTC
OK, since
C:\Qt\Qt5.9.2\5.9.2\msvc2015_64\bin
might not be correct, I tried now

- C:\Qt

-> doesn't work

C:\Qt\Qt5.9.2

This works!

So to fix this bug, could you please document in
https://community.kde.org/Craft
that the path to Qt has to be

C:\Qt\Qtx.y.z
Comment 2 Uwe Stöhr 2017-11-12 15:35:29 UTC
The bug is not completely fixed. Now I can e.g. successfully compile

craft karchive
craft kconfig
...

but

craft ki18n

fails with

CMake Error at CMakeLists.txt:36 (find_package):
  Could not find a package configuration file provided by "Qt5Script"
  (requested version 5.7.0) with any of the following names:

    Qt5ScriptConfig.cmake
    qt5script-config.cmake

  Add the installation prefix of "Qt5Script" to CMAKE_PREFIX_PATH or set
  "Qt5Script_DIR" to a directory containing one of the above files.  If
  "Qt5Script" provides a separate development package or SDK, be sure it has
  been installed.
Comment 3 Uwe Stöhr 2017-11-12 16:17:19 UTC
> (requested version 5.7.0) with any of the following names:

    Qt5ScriptConfig.cmake

Now I understand, Qt5Script is deprecated since Qt 5.6. So should i report this to the ki18n project?
Comment 4 Hannah von Reth 2017-11-12 17:19:42 UTC
No just install it, there is an option for that in the installer.
In case you want the best and easiest outcome, don't use the SDK mode and let craft build Qt with all needed dependencies.
Comment 5 Uwe Stöhr 2017-11-12 19:43:58 UTC
> No just install it, there is an option for that in the installer.

I did meanwhile but I thought that a deprecated package should no longer be used.

However, could you please document in
https://community.kde.org/Craft
that the path to Qt has to be

C:\Qt\Qtx.y.z

Then I would treat this bug report as resolved.

Many thanks for your help.