Linux compilation help -- vcpkg configuration

Heyo,

I’m looking to compile beammp for linux following the docs here: docs.beammp.com - getting started But I’m getting caught up on the cmake compilation using vcpkg.

The furthest I’ve gotten is cmake configuring with a warning, and failing to build. I have installed a vcpkg entry to /usr/local/apps/vcpkg, and as far as I can tell configured it? I’m mostly just used to building on rhel without vcpkg, so I’m a bit out of my depth here.

I’ve used vcpkg to provide httplib, which cmake was complaining about. I did this by setting VCPKG_ROOT appropriately and running vcpkg install cpp-httplib, that issue seems to have been resolved. At this point it seems to be a makefile issue, and I don’t really know how to fix that.

I’m building v2.4.0 on popos 22.4 LTS, vcpkg is just running latest per Microsoft’s docs*. The output of the (slightly modified as I don’t have any vcpkg in my home dir) commands from the docs is below.

*As a new user I can only put one link, but I’m using their " Install and use packages with CMake" which has a vcpkg installation section at the top.

zulu@pop-os:/usr/local/apps/beammp$ cmake -DCMAKE_BUILD_TYPE=Release . -B bin -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-linux
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_TOOLCHAIN_FILE

-- Build files have been written to: /usr/local/apps/beammp/bin
zulu@pop-os:/usr/local/apps/beammp$ cmake --build bin --parallel --config Release
Consolidate compiler generated dependencies of target Launcher
[  5%] Linking CXX executable BeamMP-Launcher
/usr/bin/ld: ../vcpkg_installed/x64-linux/lib/libcurl.a(openssl.c.o): in function `ossl_connect_step2':
openssl.c:(.text+0x2b6e): undefined reference to `SSL_get0_group_name'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/Launcher.dir/build.make:344: BeamMP-Launcher] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/Launcher.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
zulu@pop-os:/usr/local/apps/beammp$ 

Any help as to how to configure vcpkg, or any installation dependencies I could be missing would be appreciated.

DO NOT, I REPEAT, DO NOT DOWNLOAD VCPKG AS A PACKAGE.
CLONE IT. USE THAT AS THE TOOLCHAIN PATH.

use the path for “DCMAKE_TOOLCHAIN_FILE=” of where you cloned vcpkg to, e.g. ~/Downloads/:

cd Downloads
git clone https://github.com/microsoft/vcpkg.git
git clone --recurse-submodules https://github.com/BeamMP/BeamMP-Launcher.git

^ loading ■■■■ up

cmake -DCMAKE_BUILD_TYPE=Release . -B bin -DCMAKE_TOOLCHAIN_FILE="~/Downloads/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-linux

^ watch the toolchain path!

cmake --build bin --parallel --config Release

^ building

unsurprisingly, the official instructions are ■■■■■■■ unclear. you have to set the actual path to your cloned vcpkg.
it’s pretty sneaky, this one, i had the same situation. frantically googling “how to setup vcpkg for compiling” and ■■■■. were you to try to blindly follow the instructions from beamMP’s github or the beamMP on linux guides:

CMake Error at /usr/share/cmake/Modules/CMakeDetermineSystem.cmake:152 (message):
  Could not find toolchain file: ~/vcpkg/scripts/buildsystems/vcpkg.cmake
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

that’s because the instructions are ■■■■■■■ unclear, perhaps? @WiserTixx

you dont have to “configure” anything, except running the bootstrap. no need to fiddle and tinker with exporting any variables!!! waste of time. it’s as shrimple of a matter as cloning and compiling, that’s it. unless you’re a developer. oh well, then you should know better.

the official instructions DO need to be more precise, though. it’s a miracle that we even have a linux userbase for a game that runs only on X11. but that’s a story for another time…