Use this repo to reproduce my steps for cpack https://stackoverflow.com/questions/77554809/cpack-b-build-fails-in-parent-directory
git clone https://github.com/AndreiCherniaev/cpack_outside_of_build_folder
cd cpack_outside_of_build_folder
cmake -S src/ -B build/ -DCMAKE_BUILD_TYPE=Release --fresh
cmake --build build/ --parallel
Incorrect way
cpack -B build/ --trace --verbose
In my case I get
CPack Error: CPack generator not specified
Correct way
cpack --config build/CPackConfig.cmake -B build/
sudo dpkg -i build/cpack_test1-0.1.1-Linux.deb
sudo dpkg -r cpack_test1