novelrt / NovelRT

A cross-platform 2D game engine accompanied by a strong toolset for visual novels.
MIT License
183 stars 43 forks source link

WIP: Refactor CMake usage w/ installation targets #490

Closed capnkenny closed 2 years ago

capnkenny commented 2 years ago

STILL WORK IN PROGRESS - mainly for review/approval of general changes before continuing work

This is a refactor of how we are handling dependencies and most Platform-specific changes, as well as a way for us to allow installation of NovelRT via cmake --install .

Failures are expected at this time seeing as I have not tested Linux or macOS

capnkenny commented 2 years ago

Curious, is there a way you would rather see it structured? I also wanted to revisit find_package as it seems that it would make things easier for installation as well

FiniteReality commented 2 years ago

Curious, is there a way you would rather see it structured? I also wanted to revisit find_package as it seems that it would make things easier for installation as well

Ideally, I'd have a structure something like this:

This'll still work with the vendoring approach, but we'll have to find a way to drive the work of building them externally somehow.

RubyNova commented 2 years ago

@FiniteReality would this allow us to just use find_package in all cases and put stuff on a switch or two? Like, I'm thinking in the case of where we will be using WIC on windows but libpng on Linux, but still providing the option to use libpng on windows if people want etc.

FiniteReality commented 2 years ago

@FiniteReality would this allow us to just use find_package in all cases and put stuff on a switch or two? Like, I'm thinking in the case of where we will be using WIC on windows but libpng on Linux, but still providing the option to use libpng on windows if people want etc.

More or less, yeah. You'd have a bunch of feature flags (e.g. NOVELRT_USE_WIC which is dependent on WIN32 and defaults to ON) and then you'd select WIC or libpng.