See note in comment; concrete example of build error (when building
syncthingtray against qtforkawesome built with CMake 3.24.0):
```
CMake Error at plasmoid/lib/CMakeLists.txt:15 (find_package):
Found package configuration file:
/usr/share/qtquickforkawesome-git/cmake/qtquickforkawesome-gitConfig.cmake
but it set qtquickforkawesome-git_FOUND to FALSE so package
"qtquickforkawesome-git" is considered to be NOT FOUND. Reason given by
package:
The following imported targets are referenced, but are missing:
qtforkawesome-git
```
Building shared and static libraries at the same time has been removed as
of version 5 so this message would never be printed and it is not clear
anymore what the actual problem was.
This variable was never actually used. I suppose I've been adding it for
places where the config should be added as a prefix. However, this would be
inconsistent and now would also mean a confusing overlap with the
namespacing feature. So let's just remove it.
The config script for adding the target (which is generated
by CMake) otherwise complains that referenced dependencies
are missing. Not sure why this was never a problem. Maybe
the packages were just present anyways or CMake added
additional checks at some point.
* Fix order of arguments
* Keep building static libraries by default to stick with CMake's default
except when devel defaults are enabled and we're targeting GNU/Linux
* Unify code for use_openssl and use_crypto
* Make missing OpenSSL targets a fatal error if OpenSSL is required
* Add note that possibly the devel package is missing
* Under Tumbleweed with missing devel package I've got `OpenSSL_FOUND`
but no imported targets because the symlink from the devel package
was missing. This might be due to stale values within the CMake
cache.
Apparently the current compile check is not sufficient:
```
[ 54s] -- The C compiler identification is GNU 8.2.1
[ 54s] -- The CXX compiler identification is GNU 8.2.1
[ 54s] -- Check for working C compiler: /usr/bin/gcc-8
[ 54s] -- Check for working C compiler: /usr/bin/gcc-8 - works
[ 54s] -- Detecting C compiler ABI info
[ 54s] -- Detecting C compiler ABI info - done
[ 54s] -- Detecting C compile features
[ 54s] -- Detecting C compile features - done
[ 54s] -- Check for working CXX compiler: /usr/bin/g++-8
[ 55s] -- Check for working CXX compiler: /usr/bin/g++-8 - works
…
[ 55s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_0
[ 55s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_0 - Success
[ 55s] -- Linking tageditor against special library for std::filesystem support is not required.
…
[ 109s] FAILED: tageditor
[ 109s] : && /usr/bin/g++-8 -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -DNDEBUG -O2 -g -DNDEBUG -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now -rdynamic CMakeFiles/tageditor.dir/tageditor_autogen/mocs_compilation.cpp.o CMakeFiles/tageditor.dir/application/main.cpp.o CMakeFiles/tageditor.dir/cli/attachmentinfo.cpp.o CMakeFiles/tageditor.dir/cli/fieldmapping.cpp.o CMakeFiles/tageditor.dir/cli/helper.cpp.o CMakeFiles/tageditor.dir/cli/mainfeatures.cpp.o CMakeFiles/tageditor.dir/application/knownfieldmodel.cpp.o CMakeFiles/tageditor.dir/application/targetlevelmodel.cpp.o CMakeFiles/tageditor.dir/application/settings.cpp.o CMakeFiles/tageditor.dir/gui/fileinfomodel.cpp.o CMakeFiles/tageditor.dir/misc/htmlinfo.cpp.o CMakeFiles/tageditor.dir/misc/utility.cpp.o CMakeFiles/tageditor.dir/gui/attachmentsedit.cpp.o CMakeFiles/tageditor.dir/gui/attachmentsmodel.cpp.o CMakeFiles/tageditor.dir/gui/codeedit.cpp.o CMakeFiles/tageditor.dir/gui/entertargetdialog.cpp.o CMakeFiles/tageditor.dir/gui/mainwindow.cpp.o CMakeFiles/tageditor.dir/gui/minimumemptyspinbox.cpp.o CMakeFiles/tageditor.dir/gui/notificationlabel.cpp.o CMakeFiles/tageditor.dir/gui/notificationmodel.cpp.o CMakeFiles/tageditor.dir/gui/pathlineedit.cpp.o CMakeFiles/tageditor.dir/gui/picturepreviewselection.cpp.o CMakeFiles/tageditor.dir/gui/filefilterproxymodel.cpp.o CMakeFiles/tageditor.dir/gui/initiate.cpp.o CMakeFiles/tageditor.dir/gui/javascripthighlighter.cpp.o CMakeFiles/tageditor.dir/gui/renamefilesdialog.cpp.o CMakeFiles/tageditor.dir/gui/settingsdialog.cpp.o CMakeFiles/tageditor.dir/gui/tagedit.cpp.o CMakeFiles/tageditor.dir/gui/tagfieldedit.cpp.o CMakeFiles/tageditor.dir/gui/tageditorwidget.cpp.o CMakeFiles/tageditor.dir/dbquery/dbquery.cpp.o CMakeFiles/tageditor.dir/dbquery/musicbrainz.cpp.o CMakeFiles/tageditor.dir/dbquery/makeitpersonal.cpp.o CMakeFiles/tageditor.dir/dbquery/lyricswikia.cpp.o CMakeFiles/tageditor.dir/gui/dbquerywidget.cpp.o CMakeFiles/tageditor.dir/misc/networkaccessmanager.cpp.o CMakeFiles/tageditor.dir/renamingutility/filesystemitem.cpp.o CMakeFiles/tageditor.dir/renamingutility/filesystemitemmodel.cpp.o CMakeFiles/tageditor.dir/renamingutility/filteredfilesystemitemmodel.cpp.o CMakeFiles/tageditor.dir/renamingutility/renamingengine.cpp.o CMakeFiles/tageditor.dir/renamingutility/tageditorobject.cpp.o CMakeFiles/tageditor.dir/tageditor_autogen/3YJK5W5UP7/qrc_icons.cpp.o CMakeFiles/tageditor.dir/tageditor_autogen/3YJK5W5UP7/qrc_scripts.cpp.o CMakeFiles/tageditor.dir/tageditor_autogen/JU62CA5L7X/qrc_tageditor_translations.cpp.o -o tageditor /usr/lib64/libqtutilities.so.6.4.1 /usr/lib64/libtagparser.so.10.0.0 /usr/lib64/libQt5Concurrent.so.5.12.7 /usr/lib64/libQt5WebEngineWidgets.so.5.15.3 /usr/lib64/libc++utilities.so.5.10.4 /usr/lib64/libQt5WebEngineCore.so.5.15.3 /usr/lib64/libQt5WebChannel.so.5.12.7 /usr/lib64/libQt5Positioning.so.5.12.7 /usr/lib64/libQt5Quick.so.5.12.7 /usr/lib64/libQt5Qml.so.5.12.7 /usr/lib64/libQt5Network.so.5.12.7 /usr/lib64/libQt5PrintSupport.so.5.12.7 /usr/lib64/libQt5Widgets.so.5.12.7 /usr/lib64/libQt5Gui.so.5.12.7 /usr/lib64/libQt5Core.so.5.12.7 && :
[ 109s] /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/tageditor.dir/cli/mainfeatures.cpp.o: in function `Cli::setTagInfo(Cli::SetTagInfoArgs const&)':
[ 109s] /home/abuild/rpmbuild/BUILD/tageditor-3.4.0/build/../cli/mainfeatures.cpp:889: undefined reference to `std::filesystem::last_write_time(std::filesystem::__cxx11::path const&, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >, std::error_code&)'
[ 109s] collect2: error: ld returned 1 exit status
```
For `c++utilities` itself it doesn't seem to matter:
```
[ 33s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_0
[ 35s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_0 - Success
[ 35s] -- Linking c++utilities against special library for std::filesystem support is not required.
…
[ 43s] [22/22] /usr/bin/cmake -E cmake_symlink_library libc++utilities.so.5.10.4 libc++utilities.so.5 libc++utilities.so && :
[ 43s] + RPM_EC=0
```
For some reason the AppImage build doesn't have the problem:
```
[ 77s] -- The C compiler identification is GNU 8.2.1
[ 77s] -- The CXX compiler identification is GNU 8.2.1
[ 77s] -- Check for working C compiler: /usr/bin/gcc-8
[ 77s] -- Check for working C compiler: /usr/bin/gcc-8 -- works
[ 77s] -- Detecting C compiler ABI info
[ 78s] -- Detecting C compiler ABI info - done
[ 78s] -- Detecting C compile features
[ 78s] -- Detecting C compile features - done
[ 78s] -- Check for working CXX compiler: /usr/bin/g++-8
[ 78s] -- Check for working CXX compiler: /usr/bin/g++-8 -- works
[ 78s] -- Detecting CXX compiler ABI info
[ 78s] -- Detecting CXX compiler ABI info - done
[ 78s] -- Detecting CXX compile features
[ 79s] -- Detecting CXX compile features - done
[ 79s] -- Looking for iconv
[ 79s] -- Looking for iconv - found
[ 79s] -- Using iconv from the standard library for target c++utilities.
[ 79s] -- Using std::fstream for NativeFileStream
[ 79s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_0
[ 80s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_0 - Failed
[ 80s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_1
[ 81s] -- Performing Test COULD_COMPILE_TEST_PROGRAM_1 - Success
[ 81s] -- Linking c++utilities against library "-lstdc++fs" for std::filesystem support.
```