Skip to content

Commit

Permalink
Search for and link SFML 3 with CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
eXpl0it3r committed Sep 25, 2024
1 parent b3f0d3c commit 6d6f527
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev
run: sudo apt-get update && sudo apt-get install libxrandr-dev libxcursor-dev libxi-dev libudev-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev

- name: SFGUI - Checkout Code
uses: actions/checkout@v4
Expand All @@ -34,7 +34,7 @@ jobs:
with:
fetch-depth: 0
repository: SFML/SFML
ref: 2.6.x
ref: 3.0.0-rc.1
path: SFML

- name: SFML - Configure CMake
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ option( SFML_STATIC_LIBRARIES "Do you want to link SFML statically?"
find_package( OpenGL REQUIRED )

if( NOT TARGET sfml-graphics )
find_package( SFML 2.6 REQUIRED COMPONENTS graphics window system )
find_package( SFML 3 REQUIRED COMPONENTS Graphics )
endif()

set( INCLUDE_PATH "${PROJECT_SOURCE_DIR}/include/" )
Expand All @@ -47,7 +47,7 @@ target_include_directories( ${TARGET} SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extl
target_include_directories( ${TARGET} PRIVATE "${SOURCE_PATH}" )
target_include_directories( ${TARGET} PUBLIC $<BUILD_INTERFACE:${INCLUDE_PATH}> $<INSTALL_INTERFACE:include/> )

target_compile_features( ${TARGET} PUBLIC cxx_std_11 )
target_compile_features( ${TARGET} PUBLIC cxx_std_17 )

if( NOT SFGUI_BUILD_SHARED_LIBS )
target_compile_definitions( ${TARGET} PUBLIC SFGUI_STATIC )
Expand All @@ -62,7 +62,7 @@ if( SFGUI_INCLUDE_FONT )
target_compile_definitions( ${TARGET} PRIVATE SFGUI_INCLUDE_FONT )
endif()

target_link_libraries( ${TARGET} PUBLIC sfml-graphics sfml-window sfml-system ${OPENGL_gl_LIBRARY} )
target_link_libraries( ${TARGET} PUBLIC SFML::Graphics ${OPENGL_gl_LIBRARY} )

# Tell the compiler to export when necessary.
set_target_properties( ${TARGET} PROPERTIES DEFINE_SYMBOL SFGUI_EXPORTS )
Expand Down

0 comments on commit 6d6f527

Please sign in to comment.