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

Nuno Santos nuno.santos at imaginando.pt
Wed Jun 26 18:31:44 CEST 2024


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMakeError.log
Type: application/octet-stream
Size: 116248 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240626/0811c376/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMakeOutput.log
Type: application/octet-stream
Size: 70540 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240626/0811c376/attachment-0003.obj>
-------------- next part --------------

> 
> 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?

Thanks!

Best,

Nuno

> 
> 
> 
>> On 26. Jun 2024, at 17:11, Nuno Santos <nuno.santos at imaginando.pt> wrote:
>> 
>> Alexander,
>> 
>> Thanks for your reply.
>> 
>> In the meantime I have realised that the OPENSSL_ROOT_DIR was actually wrong due to unzipping a folder that created another folder with the same name inside of it.
>> 
>> However I have deleted the cmake cache file and the problem remains. I have even used the command:
>> 
>> git submodule foreach --recursive "git clean -dfx" && git clean -dfx
>> 
>> And ran configure again and the problem persists, now with the correct path.
>> 
>> Am I missing something?
>> 
>> 
>> Another issue is that when I try to compile a project from the examples with this custom kit I always have an error related with OPENSSL. Is there anything else I need to do in this specific case?
>> 
>> Thank you!
>> 
>> Best regards,
>> 
>> Nuno
>> 
>>> On 26 Jun 2024, at 14:29, Alexandru Croitor <alexandru.croitor at qt.io> wrote:
>>> 
>>> Hi,
>>> 
>>> You're telling the build system to link openssl, but openssl was likely not found.
>>> Perhaps you have it installed in a different path on the new machine, and the value you pass to OPENSSL_ROOT_DIR is incorrect.
>>> 
>>> 
>>>> On 26. Jun 2024, at 15:23, Nuno Santos via Interest <interest at qt-project.org> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> I’ve been building Qt 6.X.Y successfully from the source on Windows with the following configuration command:
>>>> 
>>>> configure.bat -prefix C:\Qt\6.6.3\msvc2019_static -static -static-runtime -debug-and-release -nomake examples -nomake tests -nomake benchmarks -nomake manual-tests -nomake minimal-static-tests -openssl-linked -qtnamespace com_imaginando_qt_6_6_3 -- -DOPENSSL_ROOT_DIR="C:\Qt-Utils\openssl" -DOPENSSL_USE_STATIC_LIBS=TRUE
>>>> 
>>>> But today, after installing MSVC on a new machine with a different because I need to test with a different graphics card, I got:
>>>> 
>>>> CMake Error at qtbase/cmake/QtBuildInformation.cmake:523 (message):
>>>> Feature "openssl": Forcing to "ON" breaks its condition:
>>>> 
>>>>   QT_FEATURE_openssl_runtime OR QT_FEATURE_openssl_linked
>>>> 
>>>> Condition values dump:
>>>> 
>>>>   QT_FEATURE_openssl_runtime = "OFF"
>>>>   QT_FEATURE_openssl_linked = "OFF"
>>>> 
>>>> Call Stack (most recent call first):
>>>> qtbase/cmake/QtFeature.cmake:317 (qt_configure_add_report_error)
>>>> qtbase/cmake/QtFeature.cmake:437 (qt_feature_check_and_save_internal_value)
>>>> qtbase/cmake/QtFeature.cmake:706 (qt_evaluate_feature)
>>>> qtbase/cmake/QtBaseGlobalTargets.cmake:109 (qt_feature_module_end)
>>>> qtbase/CMakeLists.txt:143 (include)
>>>> 
>>>> 
>>>> First I thought it was a CMake version problem so I have installed CMake 3.25.1 the same version of the machine I have made this same build a couple of days ago.
>>>> 
>>>> But even with CMake 3.25.1 it fails to configure in the same way. The only difference is probably the MSVC19 version because it was installed today on this machine.
>>>> 
>>>> Can someone please advise what is wrong with the configure line?
>>>> 
>>>> Thanks in advance!
>>>> 
>>>> Best regards,
>>>> 
>>>> Nuno
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Interest mailing list
>>>> Interest at qt-project.org
>>>> https://lists.qt-project.org/listinfo/interest
>>> 
>> 
> 



More information about the Interest mailing list