CMake can't find a package

Basically i need to use deal.II but cmake doesn’t seems to find it. If I install dealii with ‘sudo apt install libdeal.ii-dev’ there are no problems and cmake can find it but i can’t use the -dev version for some bugs in it.
I have a CMakeLists file with:


but if i remove the dev version and install deal.II with ‘sudo apt install libdeal.ii-9.3.2’ cmake can’t find it, i’m kinda new to linux but i think I’m passing the correct DEAL_II_DIR to let cmake find it. If I run ‘lpconfig -p | grep deal.ii’ in my terminal I got these 2 lines: (libc6,x86-64) => /lib/x86_64-linux-gnu/ (libc6,x86-64) => /lib/x86_64-linux-gnu/

so passing -DDEAL_II_DIR=/lib/x86_64-linux-gnu/ I think should work but it doesn’t, I hope this is a cmake problem and i’m posting in the correct forum, anyway suggestions?

The -dev is exactly the same version as the non-dev, so your statement about bugs makes no sense.
Typically the -dev installs the no-dev package and adds some files that are needed for building - at minimum header files and additional symlink.

It’s not “a CMake thing” it’s how it works.

Edit: I’m a bit confused, anyway I deleted what I wrote because it was kinda dumb. Gonna add more details when i figure out the actual problem

CMake 3.17 added --debug-find command-line option to enable additional human-readable output on where find_* commands search.

CMake 3.23 added a --debug-find-pkg= option to enable debug messages under specific find_package() calls.

CMake 3.23 added a --debug-find-var= option to enable debug messages for find_* calls that use specific result variables.

I’ve used --debug-find in the past and it helped address my problem.