fix: portable cmake exports and C++17 compat#92
Merged
Conversation
1. Replace std::format with C++17-compatible alternatives
- rawiv_io.cpp: std::to_string concatenation
- vtk_io.cpp: snprintf
- state_chunked_blob.cpp: add missing <stdexcept> include
2. Make cvcConfig.cmake.in tolerate missing optional deps
- Switch optional find_dependency() calls to find_package(... QUIET)
so consumers don't fail if CGAL/CUDA/ImageMagick/etc. aren't
installed — only the features that use them are affected
- Add find_package(libiimod) for IMOD MRC support
- Create synthetic PkgConfig::FFTW3 imported target in fallback path
3. Use imported targets in exported cvc::cvc link interface
- Boost: link Boost::thread/date_time/regex/filesystem instead of
raw library paths from ${Boost_LIBRARIES}
- ImageMagick: prefer ImageMagick::Magick++/MagickCore targets
- FFTW: add IMPORTED_TARGET to pkg_check_modules, prefer
PkgConfig::FFTW3 target over raw ${FFTW3_LIBRARIES}
These changes make the prebuilt SDK archives portable across systems:
consumers no longer see hard-coded /usr/lib/... paths or fatal errors
from missing optional dependencies.
7204147 to
94f57c6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes three issues that prevent downstream consumers (e.g. TexMol) from using the prebuilt libcvc SDK archives:
1. C++17 compatibility
std::formatwithstd::to_string/snprintfinrawiv_io.cppandvtk_io.cpp#include <stdexcept>instate_chunked_blob.cpp2. Portable cmake exports (no more hard-coded paths)
Boost::thread,Boost::filesystem, etc. instead of raw${Boost_LIBRARIES}ImageMagick::Magick++/ImageMagick::MagickCoreimported targetsIMPORTED_TARGETtopkg_check_modules, preferPkgConfig::FFTW3target3. Graceful optional dependencies in cvcConfig.cmake
find_dependency()calls tofind_package(... QUIET)— consumers don't fail if CGAL, CUDA, ImageMagick, etc. aren't installedfind_package(libiimod)for IMOD MRC supportPkgConfig::FFTW3imported target when pkg-config isn't availableTesting
cvc::cvctarget uses only imported targets (no/usr/lib/...paths)cvcConfig.cmakeloads successfully even when optional deps are absentAfter merge
Re-tag
v3.2.4with these fixes so TexMol CI can consume the prebuilt SDK.