Skip to content

Commit

Permalink
cmake: Replace FindSDL2.cmake by sdl2-config.cmake.
Browse files Browse the repository at this point in the history
This ports commit 6de6f9b4081a07c911932441700c54b72ec1ee1f ("CMake:
Replace FindSDL2.cmake by sdl2-config.cmake (#1530)") from Ogre.

Remove the SDL2_INCLUDE_DIRS, since the new SDL2 imported target
automatically handles that.

Signed-off-by: Maxim Cournoyer <[email protected]>
  • Loading branch information
Apteryks committed Nov 7, 2024
1 parent d30a976 commit aecdaef
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 214 deletions.
1 change: 0 additions & 1 deletion CMake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ endif()
set(INST_FILES
Packages/FindRapidjson.cmake
Packages/FindRemotery.cmake
Packages/FindSDL2.cmake
Packages/FindOGRE.cmake
Utils/FindPkgMacros.cmake
Utils/MacroLogFeature.cmake
Expand Down
2 changes: 0 additions & 2 deletions CMake/InstallDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ endif()

# TODO - most of this file assumes a common dependencies root folder
# This is not robust, we should instead source dependencies from their individual locations
get_filename_component(OGRE_DEP_DIR ${SDL2_INCLUDE_DIR}/../../ ABSOLUTE)

option(OGRE_INSTALL_DEPENDENCIES "Install dependency libs needed for samples" TRUE)
option(OGRE_COPY_DEPENDENCIES "Copy dependency libs to the build directory" TRUE)

Expand Down
206 changes: 0 additions & 206 deletions CMake/Packages/FindSDL2.cmake

This file was deleted.

2 changes: 0 additions & 2 deletions Samples/2.0/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ if( NOT OGRE_BUILD_PLATFORM_APPLE_IOS AND NOT ANDROID )
if( OGRE_BUILD_SAMPLES2 AND NOT SDL2_FOUND )
message( STATUS "Could not find dependency for samples: SDL2" )
set( OGRE_BUILD_SAMPLES2_SKIP 1 )
else()
include_directories(${SDL2_INCLUDE_DIR})
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion Samples/2.0/Common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ add_library(${OGRE_SAMPLES_COMMON_LIBRARY} STATIC ${SOURCE_FILES} ${HEADER_FILES

link_directories(${CMAKE_CURRENT_BINARY_DIR})

target_link_libraries(${OGRE_SAMPLES_COMMON_LIBRARY} ${SDL2_LIBRARY} ${OGRE_NEXT}HlmsPbs ${OGRE_NEXT}HlmsUnlit)
target_link_libraries(${OGRE_SAMPLES_COMMON_LIBRARY} SDL2::SDL2 ${OGRE_NEXT}HlmsPbs ${OGRE_NEXT}HlmsUnlit)
if( OGRE_BUILD_COMPONENT_ATMOSPHERE )
target_link_libraries(${OGRE_SAMPLES_COMMON_LIBRARY} ${OGRE_NEXT}Atmosphere)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ if( NOT IOS )
message( "Could not find SDL2. https://www.libsdl.org/" )
else()
message( STATUS "Found SDL2" )
include_directories( ${SDL2_INCLUDE_DIR} )
set( OGRE_DEPENDENCY_LIBS ${OGRE_DEPENDENCY_LIBS} ${SDL2_LIBRARY} )
set( OGRE_DEPENDENCY_LIBS ${OGRE_DEPENDENCY_LIBS} SDL2::SDL2 )
endif()
endif()

Expand Down

0 comments on commit aecdaef

Please sign in to comment.