1
General / Re: Using SFML with CLion on Windows with MSVC2022 x64 toolchain CMake and Ninja
« on: May 02, 2022, 08:21:43 pm »
I use MSVC2019 + CLion 2022.1 (using CMake 3.21) + SFML 2.5.1 and here's the CMake project template I use for it:
Unless you're altering the source, have some system-specific optimizations you require, or want to perform testing on the (unstable) master branch, I wouldn't bother building from source. There are binaries available for Windows here: https://www.sfml-dev.org/download/sfml/2.5.1. In your case, both the 2015 and 2017 versions will work.
# use static libs
set( SFML_STATIC_LIBRARIES TRUE )
#directory where the cmake files for SFML are. You will want to change this to wherever your SFML installation is
set( SFML_DIR "D:/projects/SFML-2.5.1/lib/cmake/SFML" )
find_package(SFML 2.5 COMPONENTS graphics window main network audio REQUIRED)
target_link_libraries( ${PROJECT_NAME}
PRIVATE
sfml-graphics
sfml-window
sfml-main
sfml-network
sfml-audio
)
set( SFML_STATIC_LIBRARIES TRUE )
#directory where the cmake files for SFML are. You will want to change this to wherever your SFML installation is
set( SFML_DIR "D:/projects/SFML-2.5.1/lib/cmake/SFML" )
find_package(SFML 2.5 COMPONENTS graphics window main network audio REQUIRED)
target_link_libraries( ${PROJECT_NAME}
PRIVATE
sfml-graphics
sfml-window
sfml-main
sfml-network
sfml-audio
)
Unless you're altering the source, have some system-specific optimizations you require, or want to perform testing on the (unstable) master branch, I wouldn't bother building from source. There are binaries available for Windows here: https://www.sfml-dev.org/download/sfml/2.5.1. In your case, both the 2015 and 2017 versions will work.