apt – Satisfy dependency with manual compile and install


I am using Ubuntu 18.04. My coding project needs cmake 3.18 support, so I do a manual compile and install. Now I want to remove version 3.10 that came as a dependency from another package, WITHOUT removing said package. Is there a way?

What i found so far was a way to prevent the install of cmake via apt, but I do not know if this helps me here: How to forbid a specific package to be installed?

Thanks!