I am working on a cross platform application with CMake. The project builds on Linux, but not on windows. Any help would be appreciated.
The error I get is a popup that says:
The code execution cannot proceed because SDL2d.dll was not found. Reinstalling the program may fix this problem.
For some reason CMake doesn't set this directory to CMakeCache like it does for linux.
include(FetchContent)
message("Fetching SDL2...")
FetchContent_Declare(
SDL2
GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
GIT_TAG release-2.26.3
)
FetchContent_MakeAvailable(SDL2)
As you can see I am getting this from the repository using fetchcontent. I also think it may be important to note that I am using pkgconfiglite package. I installed it using chocolatey package manager. While fetching SDL2 content I see this message in the output
pkg-config --static --libs sdl2" will return invalid information
It then goes on to list a bunch of SDL flags as on or off. I am assuming this is probably the reason for it, but as CMake seems to be using pkgconfig under the hood, this all seems like a blackbox that I don't know how to handle.
Below are my commands to make the executable and to link libraries.
add_executable(${Target}
${SRC_FILES}
)
target_link_libraries(${Target}
Vulkan::Vulkan
SDL2::SDL2
)