Reorganized CMake script; unit tests and cppcheck will be used only if CMAKE_BUILD_TYPE=Debug, otherwise they are not required