An exit trigger is triggered when trying to launch the application:
// Make sure asset folder is present from the current working directory
if (!std::filesystem::is_directory("assets")) {
std::cerr << "Could not locate assets folder from current working directory\n";
exit(-1);
}
And you have to manually copy the assets folder to the binary directory.
Solution: add to CMakeLists.txt the following custom command:
add_custom_command(TARGET ${NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different "${CMAKE_SOURCE_DIR}/assets" "$<TARGET_FILE_DIR:${NAME}>/assets"
VERBATIM
)
An exit trigger is triggered when trying to launch the application:
And you have to manually copy the assets folder to the binary directory.
Solution: add to CMakeLists.txt the following custom command: