add code to cmakelists to build samples/ refines samples. change cprintf to check for #ifndef NDEBUG. rename preproc macro for shared and static build in cpf_common.