Skip to content

Comments

Implement CMake interface library, install rules#21

Open
craftablescience wants to merge 2 commits intoiOrange:mainfrom
craftablescience:fix/proper-cmake-setup
Open

Implement CMake interface library, install rules#21
craftablescience wants to merge 2 commits intoiOrange:mainfrom
craftablescience:fix/proper-cmake-setup

Conversation

@craftablescience
Copy link

@craftablescience craftablescience commented Nov 9, 2025

This PR adds an installable interface library to the existing CMake script. You can try it by running:

cmake -B build
cmake --build build --target install

After running this command, bcdec will be accessible from other CMake projects using find_package(bcdec).

Test code and the bcdec header were split for convenience of writing the installer, and because some projects want to add the folder containing the bcdec header to include directory list but ship with their own copy of stb_image_write. No install rules are created for the test executable currently, let me know if that is desired.

The CMake version being bumped to 3.21 was necessary for PROJECT_IS_TOP_LEVEL, let me know if this is too high and I can lower it (but it will look less clean). 3.8 was already giving me warnings about deprecation on CMake 3.31, so this should be for the best for future compatibility regardless.

@iOrange
Copy link
Owner

iOrange commented Nov 11, 2025

Hi!
Thank you for this. I'm quite a noob when it comes to Cmake, so I'll read on your proposed changes and come back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants