I have graphics files that are not loading because me program generate by CMakeLists.txt is opening in "/Users/icookiez"
, not in my source directory (/Users/icookiez/Documents/Studia/Projekt C++/hit-the-bucket/
). I've try "How do I change the working directory for my program", but nothing happened.
Here is my CMakeLists.txt file:
cmake_minimum_required(VERSION 3.5)
project(Hit-The-Bucket) # VERSION 1.0 LANGUAGES CXX
SET(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(SFML 2.5 COMPONENTS graphics audio REQUIRED)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) # Solution from "How do I change the working directory for my program"
add_executable(Hit-The-Bucket main.cpp)
target_link_libraries(Hit-The-Bucket sfml-graphics sfml-window)
And my files structure is
/Users/icookiez/Documents/Studia/Projekt C++/hit-the-bucket\
CMakeLists.txt
main.cpp
assets\
fonts\
...
images\
...
What should I change in my CMakeLists.txt so ma program is opening at /Users/icookiez/Documents/Studia/Projekt C++/hit-the-bucket/