Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to set sdl2 path #378

Closed
chuyuwei opened this issue Oct 9, 2019 · 2 comments

Comments

@chuyuwei
Copy link

@chuyuwei chuyuwei commented Oct 9, 2019

I put SDL2.0 in C:\Users\chuyuwei\Desktop\duallerp\magnum-bootstrap\SDL2-2.0.10. So how should I write in cmake
it always shows
Could NOT find SDL2 (missing: SDL2_LIBRARY)
CMake Error at magnum/src/Magnum/Platform/CMakeLists.txt:289 (message):
SDL2 library, required by Sdl2Application, was not found. Set
WITH_SDL2APPLICATION to OFF to skip building it.

it is vs 2017

@mosra mosra added this to the 2019.0b milestone Oct 9, 2019
@mosra mosra added this to TODO in Platforms via automation Oct 9, 2019
@mosra

This comment has been minimized.

Copy link
Owner

@mosra mosra commented Oct 9, 2019

If that directory contains prebuilt SDL binaries (it's the SDL2-devel-2.0.10-VC.zip file), it should be enough to make the root CMakeLists look like this:

cmake_minimum_required(VERSION 3.1)
project(MyApplication)

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/modules/" ${CMAKE_MODULE_PATH})

# Add Corrade and Magnum as subprojects, add prebuilt SDL and enable Sdl2Application
list(APPEND CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/SDL2-2.0.10")
set(WITH_SDL2APPLICATION ON CACHE BOOL "" FORCE)
add_subdirectory(corrade)
add_subdirectory(magnum)

add_subdirectory(src)

This seems to be the easiest, I'll mention it in the Getting Started guide.

@mosra

This comment has been minimized.

Copy link
Owner

@mosra mosra commented Oct 15, 2019

Getting Started Guide updated in 6b64ee6 and verified to be working. It should be now much easier to follow, with less pain points for Windows users.

@mosra mosra closed this Oct 15, 2019
Platforms automation moved this from TODO to Done Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Platforms
  
Done
2 participants
You can’t perform that action at this time.