1
General / Re: SFML 2.5 CMake Migration
« on: August 10, 2019, 02:02:52 am »
IDE: CLion
System: Windows 10
SFML: 3.5.1 downloaded from https://www.sfml-dev.org/files/SFML-2.5.1-windows-gcc-7.3.0-mingw-64-bit.zip
I've unzipped the package to <project>/library/frameworks/ and used the CMakeLists.txt below but got:
The following configuration files were considered but not accepted
C:/projects/sfml/./library/frameworks/SFML-2.5.1/lib/cmake/SFML/SFMLConfig.cmake, version: 2.5.1 (64bit)
System: Windows 10
SFML: 3.5.1 downloaded from https://www.sfml-dev.org/files/SFML-2.5.1-windows-gcc-7.3.0-mingw-64-bit.zip
I've unzipped the package to <project>/library/frameworks/ and used the CMakeLists.txt below but got:
The following configuration files were considered but not accepted
C:/projects/sfml/./library/frameworks/SFML-2.5.1/lib/cmake/SFML/SFMLConfig.cmake, version: 2.5.1 (64bit)
cmake_minimum_required(VERSION 3.14)
project(sfml)
set(CMAKE_CXX_STANDARD 11)
# SFML
## If you want to link SFML statically
set(SFML_STATIC_LIBRARIES TRUE)
## In most cases better set in the CMake cache
set(SFML_DIR "./library/frameworks/SFML-2.5.1/lib/cmake/SFML")
find_package(SFML 2.5 COMPONENTS system window graphics network audio REQUIRED)
add_executable(sfml main.cpp)
target_link_libraries(sfml sfml-system sfml-window sfml-graphics sfml-network sfml-audio)
project(sfml)
set(CMAKE_CXX_STANDARD 11)
# SFML
## If you want to link SFML statically
set(SFML_STATIC_LIBRARIES TRUE)
## In most cases better set in the CMake cache
set(SFML_DIR "./library/frameworks/SFML-2.5.1/lib/cmake/SFML")
find_package(SFML 2.5 COMPONENTS system window graphics network audio REQUIRED)
add_executable(sfml main.cpp)
target_link_libraries(sfml sfml-system sfml-window sfml-graphics sfml-network sfml-audio)