I almost tried every solution on the internet. But CLion keeps failing to link with SDL2.
Here is my cmake file.
However, it keeps saying that
CMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find SDL2 (missing: SDL2_LIBRARY)
I installed the SDL2 from homebrew and moved the findsdl2.cmake file to the cmake module path.
Please tell me how to fix it. It has tortured my for a whole night. Thanks a lot.
find_file(SDL2_INCLUDE_DIR NAME SDL.h HINTS SDL2)
find_library(SDL2_LIBRARY NAME SDL2)