Fedora provides a static version of yaml-cpp with the config files installed to /usr/lib64/cmake/yaml-cpp-static. I’m trying to make use of this to build micromamba 2.0.5 but I can’t get it to prefer the static one. I figured setting -DCMAKE_MODULE_PATH=/usr/lib64/cmake/yaml-cpp-static would work but it does not:
+ /usr/bin/cmake -S . -B redhat-linux-build-micromamba -DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_Fortran_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DLIB_SUFFIX=64 -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_MODULE_PATH=/usr/lib64/cmake/yaml-cpp-static -DBUILD_LIBMAMBA=ON -DBUILD_LIBMAMBAPY=OFF -DBUILD_MAMBA=OFF -DBUILD_MICROMAMBA=ON -DBUILD_EXE=ON -DBUILD_SHARED=OFF -DBUILD_STATIC=ON
-- The C compiler identification is GNU 14.2.1
-- The CXX compiler identification is GNU 14.2.1
-- Detecting C compiler ABI info
g-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib64/ccache/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
r-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building libmamba v2.0.5
-- libmamba binary version: v2.0.0
e-- Found Python3: /usr/bin/python3.13 (found version "3.13.0") found components: Interpreter
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found nlohmann_json: /usr/share/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found version "3.11.3")
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.3.0")
-- Found Libsolv: /usr/include (found version "0.7.31")
-- Setting LTO for target libmamba::solv-cpp
-- Adding static libmamba target
-- Setting LTO for target libmamba::libmamba-static
-> Statically linking against libmamba (static) dependencies
CMake Error at cmake/Checks.cmake:9 (message):
Expected type "STATIC_LIBRARY" for target "yaml-cpp::yaml-cpp" but found
"SHARED_LIBRARY"
Call Stack (most recent call first):
libmamba/CMakeLists.txt:462 (mamba_target_check_type)
libmamba/CMakeLists.txt:699 (libmamba_create_target)
How can I achieve what I want?