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

Adjustments for finding SFML #1761

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
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
209 changes: 0 additions & 209 deletions cmake/find_modules/FindSFML.cmake

This file was deleted.

15 changes: 11 additions & 4 deletions cmake/unix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,16 @@ find_package(wxWidgets ${WX_VERSION} COMPONENTS ${WX_LIBS} REQUIRED)
include(${wxWidgets_USE_FILE})

# SFML
set(SFML_FIND_COMPONENTS system audio window network)
set(SFML_FIND_COMPONENTS System Audio Window Network)
list(TRANSFORM SFML_FIND_COMPONENTS TOLOWER OUTPUT_VARIABLE SFML2_FIND_COMPONENTS)
find_package(SFML 2 QUIET COMPONENTS ${SFML2_FIND_COMPONENTS})
if(SFML_FOUND)
list(TRANSFORM SFML2_FIND_COMPONENTS PREPEND sfml- OUTPUT_VARIABLE SFML_LIBRARIES)
else()
list(TRANSFORM SFML_FIND_COMPONENTS PREPEND SFML:: OUTPUT_VARIABLE SFML_LIBRARIES)
find_package(SFML 3 COMPONENTS ${SFML_FIND_COMPONENTS} REQUIRED)
endif()

find_package(Freetype REQUIRED)
find_package(FTGL REQUIRED)

Expand All @@ -92,15 +101,13 @@ else(NO_FLUIDSYNTH)
endif()

find_package(FreeImage REQUIRED)
find_package(SFML COMPONENTS ${SFML_FIND_COMPONENTS} REQUIRED)
find_package(OpenGL REQUIRED)
if (NOT NO_LUA)
find_package(Lua REQUIRED)
endif()
find_package(MPG123 REQUIRED)
include_directories(
${FREEIMAGE_INCLUDE_DIR}
${SFML_INCLUDE_DIR}
${FREETYPE_INCLUDE_DIRS}
${FTGL_INCLUDE_DIR}
${LUA_INCLUDE_DIR}
Expand Down Expand Up @@ -157,7 +164,7 @@ target_link_libraries(slade
${EXTERNAL_LIBRARIES}
${wxWidgets_LIBRARIES}
${FREEIMAGE_LIBRARIES}
${SFML_LIBRARY}
${SFML_LIBRARIES}
${FREETYPE_LIBRARIES}
${FTGL_LIBRARIES}
${OPENGL_LIBRARIES}
Expand Down
16 changes: 11 additions & 5 deletions cmake/win_msvc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,16 @@ endif ()
find_package(freeimage CONFIG REQUIRED)
find_package(MPG123 CONFIG REQUIRED)
find_package(OpenGL REQUIRED)
find_package(SFML COMPONENTS system audio window network CONFIG REQUIRED)

set(SFML_FIND_COMPONENTS System Audio Window Network)
list(TRANSFORM SFML_FIND_COMPONENTS TOLOWER OUTPUT_VARIABLE SFML2_FIND_COMPONENTS)
find_package(SFML 2 QUIET COMPONENTS ${SFML2_FIND_COMPONENTS})
if(SFML_FOUND)
list(TRANSFORM SFML2_FIND_COMPONENTS PREPEND sfml- OUTPUT_VARIABLE SFML_LIBRARIES)
else()
list(TRANSFORM SFML_FIND_COMPONENTS PREPEND SFML:: OUTPUT_VARIABLE SFML_LIBRARIES)
find_package(SFML 3 COMPONENTS ${SFML_FIND_COMPONENTS} REQUIRED)
endif()


# Include Search Paths ---------------------------------------------------------
Expand Down Expand Up @@ -99,14 +108,11 @@ target_link_libraries(slade
${FREETYPE_LIBRARIES}
${FTGL_LIBRARIES}
${OPENGL_LIBRARIES}
${SFML_LIBRARIES}
${WX_LIBS}
${ZLIB_LIBRARY}
freeimage::FreeImage
MPG123::libmpg123
sfml-audio
sfml-main
sfml-network
sfml-window
)

if (NOT NO_LUA)
Expand Down
Loading