Skip to content

Commit

Permalink
Merge branch 'sdl2_cmake' into 'master'
Browse files Browse the repository at this point in the history
Use SDL2 generate cmake files to find the package

See merge request OpenMW/openmw!3612
  • Loading branch information
jvoisin committed Nov 25, 2023
2 parents 881f41c + f08ab9a commit d1fc34a
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 138 deletions.
7 changes: 4 additions & 3 deletions CI/before_script.msvc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -902,8 +902,7 @@ printf "Qt ${QT_VER}... "
fi

cd $QT_SDK
add_cmake_opts -DQT_QMAKE_EXECUTABLE="${QT_SDK}/bin/qmake.exe" \
-DCMAKE_PREFIX_PATH="$QT_SDK"
add_cmake_opts -DQT_QMAKE_EXECUTABLE="${QT_SDK}/bin/qmake.exe"
for CONFIGURATION in ${CONFIGURATIONS[@]}; do
if [ $CONFIGURATION == "Debug" ]; then
DLLSUFFIX="d"
Expand All @@ -930,7 +929,7 @@ printf "SDL 2.24.0... "
rm -rf SDL2-2.24.0
eval 7z x -y SDL2-devel-2.24.0-VC.zip $STRIP
fi
export SDL2DIR="$(real_pwd)/SDL2-2.24.0"
SDL2DIR="$(real_pwd)/SDL2-2.24.0"
for config in ${CONFIGURATIONS[@]}; do
add_runtime_dlls $config "$(pwd)/SDL2-2.24.0/lib/x${ARCHSUFFIX}/SDL2.dll"
done
Expand Down Expand Up @@ -1025,6 +1024,8 @@ printf "zlib 1.2.11... "
echo Done.
}

add_cmake_opts -DCMAKE_PREFIX_PATH="\"${QT_SDK};${SDL2DIR}\""

echo
cd $DEPS_INSTALL/..
echo
Expand Down
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ include(WholeArchive)
configure_file ("${OpenMW_SOURCE_DIR}/docs/mainpage.hpp.cmake" "${OpenMW_BINARY_DIR}/docs/mainpage.hpp")

option(BOOST_STATIC "Link static build of Boost into the binaries" FALSE)
option(SDL2_STATIC "Link static build of SDL into the binaries" FALSE)
option(QT_STATIC "Link static build of Qt into the binaries" FALSE)

option(OPENMW_USE_SYSTEM_BULLET "Use system provided bullet physics library" ON)
Expand Down Expand Up @@ -483,7 +482,6 @@ set(SOL_CONFIG_DIR ${OpenMW_SOURCE_DIR}/extern/sol_config)
include_directories(
BEFORE SYSTEM
"."
${SDL2_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
${MyGUI_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR}
Expand All @@ -495,7 +493,7 @@ include_directories(
${ICU_INCLUDE_DIRS}
)

link_directories(${SDL2_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS} ${COLLADA_DOM_LIBRARY_DIRS})
link_directories(${Boost_LIBRARY_DIRS} ${COLLADA_DOM_LIBRARY_DIRS})

if(MYGUI_STATIC)
add_definitions(-DMYGUI_STATIC)
Expand Down
2 changes: 1 addition & 1 deletion apps/launcher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if (WIN32)
endif (WIN32)

target_link_libraries(openmw-launcher
${SDL2_LIBRARY_ONLY}
SDL2::SDL2
${OPENAL_LIBRARY}
components_qt
)
Expand Down
2 changes: 1 addition & 1 deletion apps/openmw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ target_link_libraries(openmw
${OPENAL_LIBRARY}
${FFmpeg_LIBRARIES}
${MyGUI_LIBRARIES}
${SDL2_LIBRARY}
SDL2::SDL2
${RecastNavigation_LIBRARIES}
"osg-ffmpeg-videoplayer"
"oics"
Expand Down
129 changes: 0 additions & 129 deletions cmake/FindSDL2.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion components/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ target_link_libraries(components
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}

${SDL2_LIBRARIES}
SDL2::SDL2
${OPENGL_gl_LIBRARY}
${MyGUI_LIBRARIES}
${LUA_LIBRARIES}
Expand Down
2 changes: 2 additions & 0 deletions extern/oics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ else()
target_link_libraries(oics local_tinyxml)
endif()

target_link_libraries(oics SDL2::SDL2)

if (MSVC)
target_precompile_headers(oics PUBLIC <algorithm> <string>)
endif()
1 change: 1 addition & 0 deletions extern/osg-ffmpeg-videoplayer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ include_directories(${FFmpeg_INCLUDE_DIRS})
add_library(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} STATIC ${OSG_FFMPEG_VIDEOPLAYER_SOURCE_FILES})
target_link_libraries(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} ${FFmpeg_LIBRARIES})
target_link_libraries(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} ${OSG_LIBRARIES})
target_link_libraries(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} SDL2::SDL2)

link_directories(${CMAKE_CURRENT_BINARY_DIR})

Expand Down

0 comments on commit d1fc34a

Please sign in to comment.