From 6d6f5274ebcf32593f69115361f63160a403a170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=BCrrenberger?= Date: Thu, 19 Sep 2024 23:53:57 +0200 Subject: [PATCH] Search for and link SFML 3 with CMake --- .github/workflows/ci.yml | 4 ++-- CMakeLists.txt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6141e94..7c93689 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 64b2936..2b864d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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/" ) @@ -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 $ $ ) -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 ) @@ -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 )