I am trying to set up SDL with Clion using mingw64 and running into issues.
Linking manually works fine, but when I try to use FindSDL.cmake it cannot find the path.
Works
project(game)
add_executable(game Main.cpp)
target_link_libraries(${PROJECT_NAME} -lmingw32 -lSDL2main -lSDL2 -mwindows)
Doesn’t
project(game)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/SDL2)
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
add_executable(game Main.cpp)
target_link_libraries(game ${SDL2_LIBRARIES})