Add BUILD_EXAMPLES and BUILD_TESTS flag