SDL2 on Clion, Could not find configuration file "SDL2Config.cmake"

Completed

Hello,

I am trying to setup SDL2 on Clion as well, I have followed those steps, and get the following error (using x86_64-w64-mingw32 and the x86_64-w64-mingw32 version of SDL2):

which is the same error as found here, however even following his steps I did not manage to fix it.

My CMakeLists.txt:

cmake_minimum_required(VERSION 3.17)
project(Test_5)
set(CMAKE_CXX_STANDARD 14)

set(SDL2_PATH "C:\\Users\\Shizune\\Downloads\\SDL2-2.0.12\\x86_64-w64-mingw32")
#set(SDL2_PATH "C:\\Users\\Shizune\\Downloads\\SDL2-2.0.12\\i686-w64-mingw32")

find_package(SDL2 REQUIRED)
include_directories( ${SDL2_INCLUDE_DIR} )

add_executable(Test_5 main.cpp)

target_link_libraries(Test_5 ${SDL2_LIBRARY} )

and main.cpp:

#include <iostream>
#include <SDL.h>


int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}

Any idea what is the issue here? Got it working under codeblocks but Clion is so much nicer, the cmake makes SDL a bit tricky to setup though. Unfortunately I am learning but not well versed in Cmake, and have 2 left hands when it comes to toolchains, I might be missing the obvious. 

Many thanks! Florian

0

Please sign in to leave a comment.