Improved constraints on build type in CMake

Signed-off-by: Amir Frankel <amirf@infinidat.com>