CMake import error when using b2 generated build
Trying to build qBittorrent using CMake 4.0.2. I built Boost 1.88.0 and libtorrent HEAD using b2. This is the error I get when configuring qBittorrent:
-- The following features have been enabled:
* GUI, Build GUI application (default: ON)
* WEBUI, Enable built-in HTTP server for remote control (default: ON)
* STACKTRACE, Enable stacktrace support (default: ON)
* DBUS, Enable support for notifications and power-management features via D-Bus (default: ON; depends on condition: GUI)
-- The following features have been disabled:
* TESTING, Build internal testing suite (default: OFF)
* VERBOSE_CONFIGURE, Show information about PACKAGES_FOUND and PACKAGES_NOT_FOUND in the configure output (only useful for debugging the CMake build scripts) (default: OFF)
* SYSTEMD, Install systemd service file. Target directory is overridable with `SYSTEMD_SERVICES_INSTALL_DIR` variable (default: OFF; depends on condition: NOT GUI)
-- Checking for module 'libtorrent-rasterbar>=1.2.19'
-- Found libtorrent-rasterbar, version 2.0.11
-- Checking for module 'libtorrent-rasterbar>=2.0.10'
-- Found libtorrent-rasterbar, version 2.0.11
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Configuring done (0.6s)
CMake Error in src/base/CMakeLists.txt:
Imported target "PkgConfig::LibtorrentRasterbar" includes non-existent path
"/opt/homebrew/include"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
CMake Error in src/base/CMakeLists.txt:
Imported target "PkgConfig::LibtorrentRasterbar" includes non-existent path
"/opt/homebrew/include"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
-- Generating done (0.2s)
CMake Generate step failed. Build files cannot be regenerated correctly.
Contents of libtorrent-rasterbar.pc:
Name: libtorrent-rasterbar
Description: libtorrent is an open source C++ library implementing the BitTorrent protocol
URL: https://libtorrent.org
Version: 2.0.11
Libs: -L"/home/samvv/qbittorrent/opt/lib" -L"/opt/homebrew/lib" -L"/usr/local/opt/boost/lib" -ltorrent-rasterbar -lboost_system -lcrypto -ldl -lssl
Libs.private: -L"/home/samvv/qbittorrent/opt/lib" -L"/opt/homebrew/lib" -L"/usr/local/opt/boost/lib" -llibtry_signal.a
Cflags: -DTORRENT_USE_LIBCRYPTO -DTORRENT_USE_OPENSSL -DTORRENT_SSL_PEERS -DTORRENT_USE_I2P=1 -DBOOST_ALL_NO_LIB -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_HAS_STD_CHRONO -DBOOST_ASIO_NO_DEPRECATED -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_SYSTEM_NO_DEPRECATED -DTORRENT_LINKING_SHARED -I"/home/samvv/qbittorrent/opt/include" -I"/opt/homebrew/include" -I"/usr/local/opt/boost/include"
CMake is choking on the /opt/homebrew/include entry in this file.
Fixed by switching to the CMake build system. Feel free to close if this is too much noise.
b2 makes some guesses about where openssl's headers can be found. This is the reason for including this path.
This seems to be the same problem as #6677 which was fixed by #6680 for RC_1_2 but not for RC_2_0. That patch works for me on RC_2_0 and allows qBittorrent's cmake configuration to finish successfully