[cmake] wrap compile related commands with if(ENABLE_*) in order not to confuse cmake with empty include etc.