Following an example I saw in a repo, I added a "RESOURCE_PATH" variable using the -D flag in my main CMakeLists:
ADD_DEFINITIONS(-DRESOURCE_PATH="${PROJECT_SOURCE_DIR}/../Resources")
I was then able to access the variable in my code:
gHelloWorld = SDL_LoadBMP(RESOURCE_PATH "/hello_world.bmp");
My question is: how does this work? According to the doc, this is adding RESOURCE_PATH to CMakeCache.txt. Is everything in the cache accessible from my project like this? Is this some hack that'll break in certain cases?
Lastly, Eclipse gives me a "Bad character sequence encountered" warning on the lines where I use RESOURCE_PATH. Assuming this is a proper approach, how can I get rid of those warnings?