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

Use system SDL2 on Linux #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
find_package(OpenGL REQUIRED)
find_package(GTK2 2.6 REQUIRED gtk)
find_package(X11 REQUIRED)
find_package(SDL2 REQUIRED)
find_library(XINPUT_LIBRARY libXi.so)
find_package(Threads REQUIRED)

Expand All @@ -95,10 +96,13 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
message(FATAL_ERROR "Could not find X11 libraries")
endif()

if(NOT SDL2_FOUND)
message(FATAL_ERROR "Could not find SDL2 libraries")
endif()

target_include_directories(Milton PRIVATE
${GTK2_INCLUDE_DIRS}
${X11_INCLUDE_DIR}
${SDL2DIR}/build/linux64/include/SDL2
${OPENGL_INCLUDE_DIR}
)

Expand All @@ -107,8 +111,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
${X11_LIBRARIES}
${OPENGL_LIBRARIES}
${XINPUT_LIBRARY}
${SDL2DIR}/build/linux64/lib/libSDL2maind.a
${SDL2DIR}/build/linux64/lib/libSDL2d.a
SDL2::SDL2
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_DL_LIBS}
)
Expand Down