graphitemaster / incbin

Include binary files in C/C++
The Unlicense
938 stars 87 forks source link

Relative path inconsistency #64

Closed JonathanGirardeau closed 2 months ago

JonathanGirardeau commented 2 months ago

Hi, I develop code that is built on windows with MSVC and on linux with GCC. I use CMake.

I use the "tool" on windows to generate data.c but my problem is I can't find a way to express relative path that works with MSVC and GCC:

It seems that with GCC the path has to be relative to the build directory and with MSVC the path has to be relative to the current working directory when the build command is executed.

JonathanGirardeau commented 2 months ago

I have finally found how to deal with relative path with CMake. I changed my code to: INCBIN(myData, "config-schema.json"); And for: