Skip to content

Commit

Permalink
CMake: use existing SDL2Config.cmake.in to find SDL2
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Aug 26, 2022
1 parent b4dbe50 commit 7682dec
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 179 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ endif()
set(LUA_INCLUDE_DIR Externals/LuaJIT/src)

if (NOT WIN32)
find_package(SDL2 REQUIRED)
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(OpenAL REQUIRED)
Expand All @@ -244,7 +245,6 @@ if (NOT WIN32)
endif()
find_package(Theora REQUIRED)
find_package(Ogg REQUIRED)
find_package(SDL REQUIRED)
find_package(LZO REQUIRED)
endif()

Expand Down
160 changes: 0 additions & 160 deletions cmake/FindSDL.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_GL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ target_include_directories(${PROJECT_NAME}
${CMAKE_SOURCE_DIR}/Externals/luabind
${CMAKE_SOURCE_DIR}/Externals/gli
${CMAKE_SOURCE_DIR}/Externals/gli/external/glm
${SDL_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS}
)

target_link_libraries(${PROJECT_NAME}
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRenderPC_R1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ target_include_directories(${PROJECT_NAME}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/Externals/luabind
${CMAKE_SOURCE_DIR}/sdk/include
${SDL_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS}
)

target_link_libraries(${PROJECT_NAME}
Expand All @@ -45,7 +45,7 @@ target_link_libraries(${PROJECT_NAME}
xrScriptEngine
xrAPI
xrMiscMath
${SDL_LIBRARIES}
${SDL2_LIBRARIES}
)

target_compile_definitions(${PROJECT_NAME}
Expand Down
2 changes: 1 addition & 1 deletion src/xrCDB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ add_library(${PROJECT_NAME} SHARED ${SRC_FILES})
target_include_directories(${PROJECT_NAME}
PRIVATE
${CMAKE_SOURCE_DIR}/src
${SDL_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS}
)

target_link_libraries(${PROJECT_NAME}
Expand Down
4 changes: 2 additions & 2 deletions src/xrCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ add_library(${PROJECT_NAME} SHARED ${SRC_FILES})

target_include_directories(${PROJECT_NAME}
PUBLIC
${SDL_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
Expand All @@ -418,7 +418,7 @@ target_include_directories(${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME}
PUBLIC
pthread
${SDL_LIBRARIES}
${SDL2_LIBRARIES}
$<$<BOOL:${USE_CRYPTOPP}>:${CRYPTO++_LIBRARIES}>
PRIVATE
xrMiscMath
Expand Down
4 changes: 2 additions & 2 deletions src/xrEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ target_include_directories(${PROJECT_NAME}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/Externals/OpenAutomate/inc
${CMAKE_SOURCE_DIR}/Externals/luabind
${SDL_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS}
)

target_link_libraries(${PROJECT_NAME}
Expand All @@ -402,7 +402,7 @@ target_link_libraries(${PROJECT_NAME}
${OGG_LIBRARIES}
xrCDB
${OPENAL_LIBRARY}
${SDL_LIBRARIES}
${SDL2_LIBRARIES}
)

target_compile_definitions(${PROJECT_NAME}
Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2629,7 +2629,7 @@ target_include_directories(${PROJECT_NAME}
${CMAKE_SOURCE_DIR}/Externals/ode/include
${CMAKE_SOURCE_DIR}/Externals/OpenAutomate/inc
${CMAKE_SOURCE_DIR}/sdk/include
${SDL_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS}
)

target_link_libraries(${PROJECT_NAME}
Expand All @@ -2649,7 +2649,7 @@ target_link_libraries(${PROJECT_NAME}
xrCDB
xrPhysics
xrNetServer
${SDL_LIBRARIES}
${SDL2_LIBRARIES}
)

target_compile_definitions(${PROJECT_NAME}
Expand Down
4 changes: 2 additions & 2 deletions src/xrGameSpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ target_include_directories(${PROJECT_NAME}
${CMAKE_SOURCE_DIR}/Externals/luabind
${CMAKE_SOURCE_DIR}/Externals/ode/include
${CMAKE_SOURCE_DIR}/Externals/OpenAutomate/inc
${SDL_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS}
)

target_link_libraries(${PROJECT_NAME}
PRIVATE
xrCore
xrMiscMath
GameSpy-oxr
${SDL_LIBRARIES}
${SDL2_LIBRARIES}
)

target_compile_definitions(${PROJECT_NAME}
Expand Down
2 changes: 1 addition & 1 deletion src/xrPhysics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ target_include_directories(${PROJECT_NAME}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/Externals/ode/include
${SDL_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS}
)

target_link_libraries(${PROJECT_NAME}
Expand Down
2 changes: 1 addition & 1 deletion src/xrScriptEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ target_include_directories(${PROJECT_NAME}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/Externals/luabind
${SDL_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS}
)

target_link_libraries(${PROJECT_NAME}
Expand Down
2 changes: 1 addition & 1 deletion src/xrSound/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ target_include_directories(${PROJECT_NAME}
${CMAKE_SOURCE_DIR}/Externals/libogg/include
${CMAKE_SOURCE_DIR}/Externals/openal/include
${OGG_INCLUDE_DIRS}
${SDL_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS}
)

target_link_libraries(${PROJECT_NAME}
Expand Down
4 changes: 2 additions & 2 deletions src/xrUICore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ target_include_directories(${PROJECT_NAME}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/Externals/lzo/include
${CMAKE_SOURCE_DIR}/Externals/luabind
${SDL_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS}
)

target_link_libraries(xrUICore
Expand All @@ -152,7 +152,7 @@ target_link_libraries(xrUICore
xrMiscMath
xrCore
xrLuabind
${SDL_LIBRARIES}
${SDL2_LIBRARIES}
)

if (WIN32)
Expand Down
2 changes: 1 addition & 1 deletion src/xr_3da/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT $
target_include_directories(${PROJECT_NAME}
PRIVATE
${CMAKE_SOURCE_DIR}/src
${SDL_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS}
)

target_link_libraries(${PROJECT_NAME}
Expand Down

0 comments on commit 7682dec

Please sign in to comment.