<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>This is my first time attempting to build/package my game with CMake, so apologies if this is a dumb questions/not the place to ask this. In short, i've been following the steps on this (<a class="moz-txt-link-freetext" href="https://github.com/SFML/SFML/wiki/Tutorial%3A-Build-your-SFML-project-with-CMake">https://github.com/SFML/SFML/wiki/Tutorial%3A-Build-your-SFML-project-with-CMake</a>)
tutorial up til now. However, once it came to the very final steps ("cmake CMakeLists.txt", "cmake --build .") my build appears to have failed loading any of my assets. This includes, pictures, sounds & fonts, while all SFML assets appear to be drawing as
usual, I cant seem to figure it out. I've attempted to directly reference their file paths in the CMakeLists.txt file, in the hopes that even one variation of the different file paths would work, but no luck. It might go without saying, but run from within
my IDE (CLion) the project runs perfectly. Just incase it's relevant (and as there's not really much code I can show here), I've included my CMakeLists.txt code, just incase that might help:</p>
<p><font size="-1">cmake_minimum_required(VERSION 3.8)<br>
<br>
# Enable debug symbols by default<br>
if(NOT CMAKE_BUILD_TYPE)<br>
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build (Debug or Release)" FORCE)<br>
endif()<br>
<br>
project(SK_IVER)<br>
<br>
set(CMAKE_CXX_STANDARD 11)<br>
<br>
# Set version information in a config.h file<br>
set(SK_IVER_VERSION_MAJOR 1)<br>
set(SK_IVER_VERSION_MINOR 0)<br>
configure_file(<br>
"${PROJECT_SOURCE_DIR}/config.h.in"<br>
"${PROJECT_BINARY_DIR}/config.h"<br>
)<br>
include_directories("${PROJECT_BINARY_DIR}")<br>
<br>
<br>
set(SOURCE_FILES<br>
main.cpp<br>
Diver.cpp<br>
Diver.h<br>
Ring.cpp Ring.h HandleEvents.cpp HandleEvents.h Background.cpp Background.h Particle.cpp Particle.h Particles.cpp Particles.h Game.cpp Game.h)<br>
<br>
# Define sources and executable<br>
set(EXECUTABLE_NAME "SK_IVER")<br>
add_executable(${EXECUTABLE_NAME} ${SOURCE_FILES})<br>
<br>
# Detect and add SFML<br>
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})<br>
find_package(SFML REQUIRED system window graphics network audio)<br>
if (SFML_FOUND)<br>
include_directories(${SFML_INCLUDE_DIR})<br>
target_link_libraries(SK_IVER ${SFML_LIBRARIES})<br>
endif()<br>
<br>
# Install target<br>
install(TARGETS ${EXECUTABLE_NAME} DESTINATION bin)<br>
<br>
# CPack packaging<br>
include(InstallRequiredSystemLibraries)<br>
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")<br>
set(CPACK_PACKAGE_VERSION_MAJOR "${myproject_VERSION_MAJOR}")<br>
set(CPACK_PACKAGE_VERSION_MINOR "${myproject_VERSION_MINOR}")<br>
include(CPack)</font></p>
<p>I've been reading about symbolic links, and have considered that this might be what's needed, have had no luck with implement one up til now. All the files in my project, are stored in a 'Resources/' folder alongside the project files and are all directly
referenced using relative paths within my code, such as:</p>
<p><font size="-1">if(!font.loadFromFile("Resources/Font/Arial_Unicode.ttf"))<br>
std::cout << "ERROR: Could not load font file." << std::endl;</font></p>
<p>(which loads and runs perfectly from within my IDE)<br>
<br>
Thanks in advance for any help or pointers on the matter,<br>
Will.<br>
<font size="-1"></font></p>
<p><br>
</p>
</body>
</html>