CMake if not short circuit

CMake if() is NOT short circuit. This requires care with undefined variables, which we show by example.

cmake_minimum_required(VERSION 2.8)

# syntax error if "undef1" is undefined
# if(1 AND ${undef1})
# endif()

if(0 OR undef2)
  message(FATAL_ERROR "unexpected behavior with undefined variable evaluated as string.")
endif()