2
« on: January 06, 2019, 07:28:41 am »
Hi I'm a CLion user on Mac and I just downloaded the latest version of SFML(2.5.1).
I've been struggling running the example files for more than five hours.
I tried almost every thing on the internet and I can't find how to run this on Mac/CLion/SFML 2.5.1 version.
Please can you help me run this?
I'm trying to run the Window.cpp file in the example file when you download the 2.5.1 SFML.
Here's my CMakeLists.txt
cmake_minimum_required(VERSION 3.12)
project(window)
set(CMAKE_CXX_STANDARD 14)
include_directories(./Downloads/SFML-2.5.1-macos-clang/include/SFML) // I'm not sure if it's right.
add_executable(window
Window.cpp)
Problem is error kept saying that "fatal error: 'SFML/Window.hpp' file not found"
When I added these two lines
find_package(SFML 2.5 COMPONENTS graphics audio REQUIRED)
target_link_libraries(window SFML::graphics SFML::audio)
This error came out
"CMake Error at CMakeLists.txt:5 (find_package):
By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "SFML", but
CMake did not find one.
Could not find a package configuration file provided by "SFML" (requested
version 2.5) with any of the following names:
SFMLConfig.cmake
sfml-config.cmake
Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set
"SFML_DIR" to a directory containing one of the above files. If "SFML"
provides a separate development package or SDK, be sure it has been
installed."
Please help me...
Thank you so much.