atomicobject / heatshrink

data compression library for embedded/real-time systems
ISC License
1.31k stars 176 forks source link

Add CMake build script #77

Open tamasmeszaros opened 1 year ago

tamasmeszaros commented 1 year ago

Hello there! I'm sending this PR on behalf of the PrusaSlicer team. We are considering to use heatshrink in our software and put together a CMake build script which supports installing the library and exporting CMake config scripts for downstream projects to be able to find the installed library.

BenBE commented 1 year ago

@tamasmeszaros Mind to squash those two commits and add proper newlines at EOF?

tamasmeszaros commented 1 year ago

@tamasmeszaros Mind to squash those two commits and add proper newlines at EOF?

Absolutely no. Thank you for considering merging the PR. Should I do it?

BenBE commented 1 year ago

@tamasmeszaros Mind to squash those two commits and add proper newlines at EOF?

Absolutely no. Thank you for considering merging the PR. Should I do it?

I'm not a maintainer of this repository; just happened to take a look at it because I'm using this library myself.

artyom-poptsov commented 4 months ago

Hello! It would be nice to have CMake file for the project indeed, as PrusaSlicer project already patches heatshrink to add CMake build script thus making a custom version of heatshrink. And that is very inconvenient for packagers.

I'm trying to package heatshrink along with the new version of PrusaSlicer for GNU Guix and the situation gives me additional bumps on the road. Please consider merging this pull request, maybe with incorporating some ideas from PrusaSlicer patches.

Thanks!

-avp

artyom-poptsov commented 4 months ago

Also unfortunately in Nix patch there are no tests in CMakeLists.txt.

silentbicycle commented 4 months ago

I'm not opposed to including that but I'm not deeply familiar with CMake -- would it be a problem to include it in a contrib/ subdirectory? To signal that it isn't the primary way to build the project, but provided as a convenience.

I've been horrendously busy with moving and work projects the last couple months, but should be coming up for air soon and plan to scoop up this and some other things in a new release.

tamasmeszaros commented 3 months ago

@silentbicycle Please note that the tests fail when building in Debug mode. See this action run: https://github.com/tamasmeszaros/heatshrink/actions/runs/9120973451 Feel free to incorporate the workflow file into your repo, I will not make a separate PR for that,

tamasmeszaros commented 3 months ago

I'm not opposed to including that but I'm not deeply familiar with CMake -- would it be a problem to include it in a contrib/ subdirectory? To signal that it isn't the primary way to build the project, but provided as a convenience.

I've been horrendously busy with moving and work projects the last couple months, but should be coming up for air soon and plan to scoop up this and some other things in a new release.

I've put the CMake stuff into cmake subdirectory. I actually forgot that you requested 'contrib' but I would not change it now it you are ok with 'cmake' subdir. I fully understand your perspective about CMake. It is unusual to not place the top level CMake file into the project root and will create confusion, but I think it is managable by any maintainer and is better than not having any CMake build.