Cmake fails to compile on openbsd

I’m trying to compile the latest 3.0.0 version since it isn’t available in my packages repositories. I get in the following trouble:

 $ cmake .. -DCMAKE_INSTALL_PREFIX=`kf5-config --prefix` 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-sylvain'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-sylvain'
Installing in /usr/local. Run /home/sylvain/hack/amarok-3.0.0/amarok-3.0.0-build/prefix.sh to set the environment for Amarok.
-- Could not set up the appstream test. appstreamcli is missing.
CMake Error at CMakeLists.txt:32 (find_package):
  By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5" (requested
  version 5.15.0) with any of the following names:

    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
  to a directory containing one of the above files.  If "Qt5" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!
 $ uname -a
OpenBSD lap.saboua.xyz 7.5 GENERIC.MP#82 amd64
 $ 

Seems like Qt5 packages were not found. If it is installed, you have to tell cmake where its installed by using CMAKE_PREFIX_PATH

cmake -DCMAKE_PREFIX_PATH=/path/to/qt5

Some progress it seems …

 $ cmake .. -DCMAKE_INSTALL_PREFIX='/usr/local/lib/qt5'  
CMake Error: CMake was unable to find a build program corresponding to "Ninja".  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!
 $ 

Seems working, compilation is ~40%:

$ cmake .. -DCMAKE_PREFIX_PATH='/usr/local/lib/qt5' \
  -DCMAKE_C_COMPILER=/usr/bin/clang \
  -DCMAKE_CXX_COMPILER=/usr/bin/clang-cpp \
  -DCMAKE_PREFIX_PATH=/usr/local/lib/qt5/cmake
$ make
$ doas make install

Thank you !

The first command above works, now errors appear while attempting to make :

[ 53%] Linking CXX executable ../bin/testamarok
ld: error: undefined symbol: operator delete(void*)
>>> referenced by mocs_compilation.cpp
>>>               CMakeFiles/testamarok.dir/testamarok_autogen/mocs_compilation.cpp.o:(TestAmarok::~TestAmarok())
>>> referenced by Amarok.cpp
>>>               CMakeFiles/testamarok.dir/__/src/core/support/Amarok.cpp.o:(QtSharedPointer::ExternalRefCountData::operator delete(void*))
>>> referenced by Amarok.cpp
>>>               CMakeFiles/testamarok.dir/__/src/core/support/Amarok.cpp.o:(QList<AmarokSharedPointer<Meta::Track>>::node_destruct(QList<AmarokSharedPointer<Meta::Track>>::Node*, QList<AmarokSharedPointer<Meta::Track>>::Node*))

ld: error: undefined symbol: vtable for __cxxabiv1::__si_class_type_info
>>> referenced by mocs_compilation.cpp
>>>               CMakeFiles/testamarok.dir/testamarok_autogen/mocs_compilation.cpp.o:(typeinfo for TestAmarok)
>>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)

ld: error: undefined symbol: operator new(unsigned long)
>>> referenced by Amarok.cpp
>>>               CMakeFiles/testamarok.dir/__/src/core/support/Amarok.cpp.o:(Amarok::actionCollection())
>>> referenced by Amarok.cpp
>>>               CMakeFiles/testamarok.dir/__/src/core/support/Amarok.cpp.o:(QList<AmarokSharedPointer<Meta::Track>>::node_copy(QList<AmarokSharedPointer<Meta::Track>>::Node*, QList<AmarokSharedPointer<Meta::Track>>::Node*, QList<AmarokSharedPointer<Meta::Track>>::Node*))

ld: error: undefined reference due to --no-allow-shlib-undefined: __dynamic_cast
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: operator delete(void*)
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: operator new(unsigned long)
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::~basic_string()
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: __cxa_guard_acquire
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: __cxa_guard_release
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: vtable for __cxxabiv1::__si_class_type_info
>>> referenced by ../bin/libamaroklib.so.1.0.0
ld: error: undefined reference due to --no-allow-shlib-undefined: vtable for __cxxabiv1::__vmi_class_type_info
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: vtable for __cxxabiv1::__class_type_info
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: __cxa_pure_virtual
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: std::nothrow
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: operator new(unsigned long, std::nothrow_t const&)
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: __cxa_bad_typeid
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: std::__1::thread::detach()
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: std::__1::thread::~thread()
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: std::__1::__thread_struct::__thread_struct()
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: undefined reference due to --no-allow-shlib-undefined: std::__1::__throw_system_error(int, char const*)
>>> referenced by ../bin/libamaroklib.so.1.0.0

ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error 1 in . (tests/CMakeFiles/testamarok.dir/build.make:145 'bin/testamarok': cd /home/sylvain/hack/amarok-3.0.0/amarok-3.0.0-build/tes...)
*** Error 2 in . (CMakeFiles/Makefile2:3878 'tests/CMakeFiles/testamarok.dir/all': make -s -f tests/CMakeFiles/testamarok.dir/build.make tes...)
*** Error 2 in /home/sylvain/hack/amarok-3.0.0/amarok-3.0.0-build (Makefile:146 'all': make -s -f CMakeFiles/Makefile2 all)
 $ 

 $ 

should be /usr/bin/clang++