[Interest] Error when configuring Qt 6.X.Y to build from source on Windows with -openssl-linked

Alexandru Croitor alexandru.croitor at qt.io
Thu Jun 27 10:05:39 CEST 2024



> On 26. Jun 2024, at 18:31, Nuno Santos <nuno.santos at imaginando.pt> wrote:
>
> Alexandru,
>
>
> > On 26 Jun 2024, at 16:17, Alexandru Croitor <alexandru.croitor at qt.io> wrote:
> >
> > You could try using --debug-find as described on https://wiki.qt.io/Qt_Build_System_Glossary#CMake_find_package_troubleshooting
> >
> > to see which paths cmake is considering when trying to find the openssl package, perhaps that reveals some new info why it is not found.
>
> I’ve checked all the files and I can’t find the reason for not working. Every path seems to be right.
>
> >
> > I would also check what's the value of OpenSSL_DIR in CMakeCache.txt after the error, just to confirm that the package is not found, and it's not some other issue.
>
> As you can see in the attached files, there is no such directory.
>


The attached files are not CMakeCache.txt. I said to check the value of OpenSSL_DIR in CMakeCache.txt.
CMakeError.log and CMakeOutput.log are most of the time useless for troubleshooting.
They have been superseded by CMakeFiles/CMakeConfigureLog.yaml.
But in this case i don't think looking into that file would help.

>
> >
> > Regarding compiling a project from the examples, the build system does not 'remember' which openssl was used when building qt, so you have to set the OPENSSL_ROOT_DIR
> > variable also when configuring the project, either via IDE kit settings, or on the command line.
>
> I’ve tried to set that variable in my ways, via QtCreator, via Windows environment variables with no success. Can you please tell me exactly where should I set that variable?

The --debug-find argument needs to be passed to the cmake executable or qt-cmake wrapper on the command line.
In Qt Creator, it should be set in the kit cmake options.
Preferences -> Kit -> Click on kit -> At the bottom next to CMake Configuration click on Change button -> At the bottom there is an Additional CMake options text field.

The OPENSSL_ROOT_DIR var needs to be set as a cache variable. Either on the command line as a -D option e.g. -DOPENSSL_ROOT_DIR=<path>, or via cmake-gui app, or in Qt Creator as a project cache variable.

[cid:da74fb84-ef8b-438e-b9fe-ee9f1a04ddcd at eurprd02.prod.outlook.com]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240627/13802216/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2024-06-26 at 19.13.16.png
Type: image/png
Size: 154876 bytes
Desc: Screenshot 2024-06-26 at 19.13.16.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240627/13802216/attachment-0001.png>


More information about the Interest mailing list