I've read a similar answer, which solved the problem caused by different chip architecture. But it seems totally different from the problem here.
====================[ Build | OpenGLTest | Debug ]==============================
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/baix3xiaoruo/Code/ClionProjects/OpenGLTest --target OpenGLTest -- -j 6
Scanning dependencies of target OpenGLTest
[ 50%] Building CXX object CMakeFiles/OpenGLTest.dir/main.cpp.o
[100%] Linking CXX executable OpenGLTest
Undefined symbols for architecture arm64:
"_glfwCreateWindow", referenced from:
_main in main.cpp.o
"_glfwInit", referenced from:
_main in main.cpp.o
"_glfwMakeContextCurrent", referenced from:
_main in main.cpp.o
"_glfwPollEvents", referenced from:
_main in main.cpp.o
"_glfwSetKeyCallback", referenced from:
_main in main.cpp.o
"_glfwSetWindowShouldClose", referenced from:
__Z12key_callbackP10GLFWwindowiiii in main.cpp.o
"_glfwSwapBuffers", referenced from:
_main in main.cpp.o
"_glfwTerminate", referenced from:
_main in main.cpp.o
"_glfwWindowShouldClose", referenced from:
_main in main.cpp.o
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
make[3]: *** [OpenGLTest] Error 1
make[2]: *** [CMakeFiles/OpenGLTest.dir/all] Error 2
make[1]: *** [CMakeFiles/OpenGLTest.dir/rule] Error 2
make: *** [OpenGLTest] Error 2