Skip to content

Migrate build from make to cmake#121

Closed
slanzi00 wants to merge 5 commits into
mainfrom
11-build-is-very-fragile
Closed

Migrate build from make to cmake#121
slanzi00 wants to merge 5 commits into
mainfrom
11-build-is-very-fragile

Conversation

@slanzi00

Copy link
Copy Markdown
Member

The existing GNU Make build was fragile. This PR replaces both Makefile and src/Makefile with a proper CMake setup.

  • each UPS package is wrapped in a proper INTERFACE IMPORTED target (deps::hdf5, deps::genie, etc.)

  • Out-of-source builds — build artifacts go under build/, keeping the source tree clean.

  • Version derived from git tagproject(VERSION ...) is populated by git describe --tags, so the version is no longer a hardcoded string.

  • Optional features as CMake optionsENABLE_TMS (default ON) and ENABLE_TESTEXE (default OFF) replace the ad-hoc ENABLE_TMS=0 Make variable.

  • SANDReco auto-detection — unchanged in behaviour, but now expressed as a proper CMake if(DEFINED ENV{...}) block that creates a no-op target when absent, so consumers can link unconditionally.

  • Expanded warning set-Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wimplicit-fallthrough -Wextra-semi -Wold-style-cast replaces the old -Wall only.

Samuele Lanzi and others added 5 commits February 25, 2026 11:08
Replace Makefile and src/Makefile with a modern CMake build system (≥3.20)
that produces the same artifacts: libND_CAFMaker.so, makeCAF, and optionally
testHDF.
- Version derived from git tags instead of hardcoded
- ROOT uses imported targets (ROOT::*) instead of root-config flags
- find_ups_package() calls expanded to multi-line keyword style
- Add .cmake-format.yaml with find_ups_package() signature
- Extract find_ups_package() helper into cmake/FindUPSPackage.cmake
- Drop the RelWithDebInfo CMAKE_BUILD_TYPE default
- Replace -Wall with a full set of warning flags (-Wextra, -Wpedantic,
  -Wconversion, -Wsign-conversion, -Wshadow, etc.)
- Add ASan + UBSan for Debug builds, with _GLIBCXX_SANITIZE_STD_ALLOCATOR
  on GCC
- Add "Build environment" section documenting the required Singularity
  image (fnal-wn-sl7:latest) and ndcaf_setup.sh step before CMake
@slanzi00 slanzi00 linked an issue Feb 27, 2026 that may be closed by this pull request
@slanzi00 slanzi00 requested a review from chenel February 27, 2026 13:34
@alexbooth92

Copy link
Copy Markdown
Member

Is this PR superseded by #123? It seems like the feature branch in that PR has all the commits of this one. If so could we add the information given in the description here to 123 and close this PR?

@slanzi00

Copy link
Copy Markdown
Member Author

Yes, exactly! I'll move the description over to #123.

@slanzi00 slanzi00 closed this Mar 20, 2026
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.

build is very fragile

2 participants