question about the demo showed in cmake-packages(7) documentation

cmake-packages(7) — CMake 3.30.1 Documentation
The cmake scripts snippet showed in above linking uses cmake command “configure_file()” to generante configuration file. But in another link CMakePackageConfigHelpers — CMake 3.30.1 Documentation, it says we should not use the plain configure_file() command, I’ve sceenshoted this description in the following picture.

So which rule should I follow? Thanks!

Best wishes!

The cmake-packages(7) manual’s example ClimbingStatsConfig.cmake does not suffer from any of the pitfalls that configure_package_config_file is meant to address. However, the example could perhaps be updated to use configure_package_config_file for completeness.

See also the Importing and Exporting Guide’s section on creating packages.

Thank you very much!
I’ve read that guide you provided above which is really helpful! :nerd_face:

So I have another little suggestion, in this page CMake Reference Documentation — CMake 3.30.1 Documentation , may we put “GUIDE” section more front, just after “Introduction”? I think “guide” is more fundamental and important to cmake novice!
I also want to learn your opinion, thanks!

Best wishes!