Struggling with cmake dependencies

The most important piece of info upstream is the FindRe2.cmake module, which documents how to add additional paths to the search paths: https://github.com/manticoresoftware/manticoresearch/blob/c63d173592388ebaf8f17478c4930a3fce903c0f/cmake/FindRE2.cmake#L15-L18

That means "-DWITH_RE2_INCLUDES=${re2}/include" "-DWITH_RE2_LIBS=${re2}/lib" might do the trick. YMMV, I didn’t actually test that, but it should get you closer.

NB: There is an open PR that changes re2 to build with CMake: re2: switch to CMake by azahi · Pull Request #196123 · NixOS/nixpkgs · GitHub. But that won’t help you in this case.