Skip to content

fix(cmake): correct install dirs and use GNUInstallDirs#20

Merged
csparker247 merged 3 commits into
developfrom
fix/cmake-install-gnuinstalldirs
Jun 26, 2026
Merged

fix(cmake): correct install dirs and use GNUInstallDirs#20
csparker247 merged 3 commits into
developfrom
fix/cmake-install-gnuinstalldirs

Conversation

@csparker247

Copy link
Copy Markdown
Member

Summary

  • find_package(EduceLabCore) failed because the package config was installed to lib/cmake/EduceLab, which does not match CMake's search glob <prefix>/<libdir>/cmake/EduceLabCore*. Config files now install to lib/cmake/EduceLabCore.
  • Replaced hardcoded lib/include install destinations with GNUInstallDirs (CMAKE_INSTALL_LIBDIR/INCLUDEDIR/BINDIR).
  • Dropped the PUBLIC_HEADER install rule, which flattened every header into a single directory and broke nested includes such as "educelab/core/io/MeshIO.hpp". Headers are now installed via a directory copy that preserves the io/, types/, and utils/ subdirectories.

Testing

  • Configured, built, and installed to a temp prefix — headers land under include/educelab/core/{io,types,utils}/... and config under lib/cmake/EduceLabCore/.
  • Verified a downstream project using find_package(EduceLabCore REQUIRED) + target_link_libraries(... educelab::core) configures and builds against the install.

🤖 Generated with Claude Code

csparker247 and others added 3 commits June 27, 2026 00:37
find_package(EduceLabCore) could not locate the package because the
config files were installed to lib/cmake/EduceLab, which does not match
CMake's <prefix>/<libdir>/cmake/EduceLabCore* search glob. Install them
to lib/cmake/EduceLabCore instead.

Replace hardcoded lib/include destinations with GNUInstallDirs
(CMAKE_INSTALL_LIBDIR/INCLUDEDIR/BINDIR).

Drop the PUBLIC_HEADER install, which flattened all headers into a
single directory and broke nested includes like
"educelab/core/io/MeshIO.hpp". Install the include tree directly so the
io/, types/, and utils/ subdirectories are preserved.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Builds, installs to a prefix, then configures and builds a small
consumer project via find_package(EduceLabCore) to guard against
broken install layouts and packaging regressions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@csparker247 csparker247 merged commit f4afd7c into develop Jun 26, 2026
5 checks passed
@csparker247 csparker247 deleted the fix/cmake-install-gnuinstalldirs branch June 26, 2026 22:42
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