Open illuhad opened 4 years ago
The problem here is that the test case uses relative path to find the file, as in
load_bitmap_mirrored("../../share/Brommy.bmp", size, input);
This is entirely unreliable, since the build directory can be anywhere in the file system. It won't run without this very specific assumption of path. I suggest to fix it by always loading the file from the build directory, such as ./Brommy.bmp
. Then, during build, we let CMake to copy Brommy.bmp
to the specified build path. This way it can always work.
Wait a minute, my previous comment would only fix the in-tree file. If make install
is used, search path again becomes a problem... I imagine the full solution would be, first, define a preprocessor macro for the path through CMake... And if it's not found, then fallback to searching the executable's directory, so both running from build
and running from /usr is supported...
It used to work. But we don't know why. Now it doesn't and we know why. We should transform this to a state where it works and (ideally, but at a lower priority) we know why.