adepierre / Botcraft

Botcraft is a cross-platform C++ library to create bots that connect and interact with Minecraft servers with (optional) integrated OpenGL renderer
GNU General Public License v3.0
405 stars 43 forks source link

Binaries should not be tied down to location of repository #52

Closed maxsupermanhd closed 2 years ago

maxsupermanhd commented 3 years ago

Cmake build system made possible to build projects from outside of root directory in order to have several builds saved, technique with all binaries in project root under ./bin/ is horrible and should be reconsidered.

adepierre commented 3 years ago

Yeah I agree it's not ideal. The main problem here is that the exe expects the assets to be located at ../Assets/<version> so if the output is moved, nothing would work.

I might eventually rework this system one day, perhaps by copying all the required assets at the right location, but this is clearly not a priority.

maxsupermanhd commented 3 years ago

Why not move assets with binary? Or store them in user-based storage like in ~/.local/share

Not that this is very bad but it is super annoying to deal with. You also can bake assets right into binary, not only it can speed stuff up but will provide self-contained binary that relies on no environment

adepierre commented 3 years ago

Yes moving the assets with binary is what I meant when I said "copying the required assets". I think this is the best approach.

I'm not a fan of user based storage because of two reasons:

  1. you need to write OS-specific code to deal with it
  2. removing botcraft from a computer is generally done by simply deleting a folder, and I'd like to keep it this way so there are no lost files lying you don't know where
adepierre commented 2 years ago

Done with latest version. You can use BOTCRAFT_OUTPUT_DIR in cmake to specify a custom output folder.