Skip to content

Add CMake install support with package configuration#420

Open
sharjith wants to merge 1 commit intoBinomialLLC:masterfrom
sharjith:add-cmake-install-support
Open

Add CMake install support with package configuration#420
sharjith wants to merge 1 commit intoBinomialLLC:masterfrom
sharjith:add-cmake-install-support

Conversation

@sharjith
Copy link

@sharjith sharjith commented Jan 4, 2026

Description

This PR adds CMake installation support to enable proper library installation and integration with other CMake projects.

Changes

  • Added install() commands for the basisu_encoder library
  • Added installation for executables (basisu and examples)
  • Added installation for public headers (transcoder, encoder, zstd)
  • Created CMake package configuration files (basisuConfig.cmake.in)
  • Exported targets with basisu:: namespace for use with find_package()
  • Follows CMake's GNUInstallDirs conventions for cross-platform compatibility

Benefits

  • Users can install Basis Universal system-wide or to custom locations
  • Other CMake projects can easily find and link against Basis Universal using:
  find_package(basisu REQUIRED)
  target_link_libraries(my_target PRIVATE basisu::basisu_encoder)
  • Provides standard CMake package versioning support

Testing

  • Tested installation on Linux
  • Verified find_package() works correctly in downstream projects
  • All existing build configurations remain unchanged

Notes

  • The changes are fully backward compatible
  • Installation is optional (doesn't affect normal builds)

- Add install targets for basisu_encoder library
- Add install targets for executables (basisu, examples)
- Add install targets for headers (transcoder, encoder, zstd)
- Generate CMake package config files for find_package() support
- Export targets with basisu:: namespace
- Include GNUInstallDirs for standard installation paths
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.

1 participant