If you want to build for debug (including source information, i.e. -g) when compiling, use
cmake -DCMAKE_BUILD_TYPE=Debug <path>
If you want to build a release build, you can use
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo <path>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…