find_package not work


set(ZLIB_ROOT "D:\TEST\zlib")

not work

find_package(ZLIB PATHS "D:\TEST\zlib" )

What does I lack of with find_package?

I suspect that PATHS arguments are more like ZLIB_DIR which want the -config.cmake to be available directly underneath.

how to let findpackage work

Without more information, I can’t say what’s even wrong here. You can use --debug-find to get more information about what CMake is doing during find_* commands.