Chatterino / chatterino2

Chat client for https://twitch.tv
MIT License
2.02k stars 445 forks source link

Clean up QtCreator's package manager setup #5305

Closed hemirt closed 2 months ago

hemirt commented 5 months ago

Added a QtCreatorPackageManager.cmake that gets auto imported when using Qt>6 with CMake and "Package manager auto setup" option (by default) turned on.

In this file, options to skip the automatic packagae manager setup is set up.

Options to skip exclusively conan, or vcpkg, are also set to on for self-documentation for the user.

Contributors using Qt Creator should pick just one (or none) to use and disable the other one, just now by default all are disabled.

A general status message with information about this gets sent right at the start of cmake command (as the QtCreatorPackageManager.cmake is one of the earliest things Qt Creator runs).

https://www.qt.io/blog/qt-creator-cmake-package-manager-auto-setup

[Extra Notes] Vcpkg seems like it's not configured well to use with Qt Creator - since it downloads qt (and/or builds it). Conan might not have this "issue" but I did not test it out, since even the build of openssl or boost was taking well over 15 minutes already.

hemirt commented 3 months ago

Conan now autoexecutes and downloads or builds the libraries (it builds zlib and openssl for me)

But when trying to run chatterino from qt creator, I get these errors

image

image

The folder build\Desktop_Qt_6_7_1_MSVC2019_64bit-Debug\bin where chatterino.exe is located is missing the libcrypto-3-x64.dll and libssl-3-x64.dll files.

If I copy the files from build\Desktop_Qt_6_7_1_MSVC2019_64bit-Debug\conan-dependencies\build\conan\bin (where these are the only two files), chatterino then starts.

(PS: this folder build\Desktop_Qt_6_7_1_MSVC2019_64bit-Debug\conan-dependencies\build\conan also contains the Chatterino2 folder mentioned in the conanfile again with only those two dlls)

I'm not sure if this is a problem with the conanfile, or the cmakelists file.

pajlada commented 3 months ago

This PR works for me - I don't get the error you get with missing openssl DLLs, my kit's Run configuration looks like this: image

If I disable "Add build library search path to PATH", I get your error.

If I launch the exe without qt creator, I also get your error.

I think this is all acceptable.

Could you check if you have the "Add build library search path to PATH" disabled in your run configuration?

hemirt commented 2 months ago

Could you check if you have the "Add build library search path to PATH" disabled in your run configuration?

I do have that checked. I can't launch the app inside Qt creator, nor outside it. Did your configuration copy the libcrypto files into the bin folder next to the chatterino.exe? chatterino2\build\Desktop_Qt_6_7_1_MSVC2019_64bit-Debug\bin Mine does not.

Unchecking this setting did not change anything for me.

Maybe your build library search path (unsure what this variable is supposed to be) somehow has these openssl libraries?

Checking and unchecking this setting only seems to add C:\Qt\6.7.1\msvc2019_64\bin into the Path variable (in the environment section), though I already have this in my path variable (i.e. it's already in the Path variable shown value).

So if you get the same errors for the same libraries missing, I'm not sure whats going on, my only guess would be you already have openssl libraries in path, but in that case you would be getting missing qt libraries instead of libcrypto and libssl, is my guess. If you get the same libcrypto and libssl errors, then I'm not sure what or where is the problem.

pajlada commented 2 months ago

My crypto DLLs are not added to the same directory as chatterino.exe is, no. It seems my version of Qt creator (which was freshly installed at v13.0.2) handles adding conan to PATH before running chatterino.exe

image