#Trying to link CMake and SFML gives errors

20 messages · Page 1 of 1 (latest)

nimble ferry
#

CMake Error at CMakeLists.txt:19 (find_package):Could not find a configuration file for package "SFML" that is compatible
with requested version "".

The following configuration files were considered but not accepted:

C:/Users/user/Desktop/CLibs/SFML-2.6.1/lib/cmake/SFML/SFMLConfig.cmake, version: 2.6.1 (64bit)CMake (find_package)

fallow sirenBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

nimble ferry
#

CMakelists.txt

#
cmake_minimum_required(VERSION 3.28.1)
project(SFMLProject VERSION 0.1.0)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

set(SOURCE_FILES
)

add_executable(${PROJECT_NAME} ${SOURCE_FILES})

set(SFML_DIR "C:/Users/user/Desktop/CLibs/SFML-2.6.1/lib/cmake/SFML")
find_package(SFML COMPONENTS graphics window system REQUIRED)

target_link_libraries(${PROJECT_NAME} sfml-graphics sfml-window sfml-system)
#

please help

#

ive had this issue for days

#

no one has helped

acoustic geyser
#

Did you Google cmake find_package for docs/examples how to specify version?

nimble ferry
#

2nd part no

#

how do I

acoustic geyser
#

Well version is listed in the basic signature

nimble ferry
#

so "find_package(SFML 2.6.1 COMPONENTS graphics window system REQUIRED)"?

#

?

nimble ferry
#

??

#

@acoustic geyser

#

someone help please

nimble ferry
#

help

nimble ferry
#

help

cosmic helm