it may be damaged or incomplete

How can I avoid the error?
STEP:
git clone GitHub - dev-cafe/cmake-cookbook: CMake Cookbook recipes.
cd cmake-cookbook/chapter-11/recipe-01/cxx-example
mkdir build
cd build
cmake …
cpack

result:
click and install it

but finally it show the error

It doesn’t appear as though the example you’re referring to is set up to use CPack properly. I would recommend asking the author(s) of that project to clarify documentation.

Thanks for your advance.
Do you have the simple sample with cpack (macOS .dmg)?
My subject is create a .dmg and install it with interface.

I don’t have a simple one off hand, sorry. I do know you should use add_executable(MACOSX_BUNDLE), use include(CPack), and set a bunch of CPACK_ settings at least. Those might help you find other examples on GitHub or such. Others here may have better information as well.