3 Commits
Author SHA1 Message Date
suter_aandClaude Opus 5 fd0b3c3b19 cmake: portability and macOS fixes
Fixes found while reviewing the cmake setup, with a focus on macOS. All
changes are either platform neutral or guarded by if (APPLE).

Portability / correctness:
* CMP0167 was guarded by 'CMAKE_VERSION GREATER_EQUAL 3.3', a *numeric*
  comparison which is true on e.g. cmake 3.22. Since the policy only exists
  since cmake 3.30, configuring aborted on RHEL 9 / Ubuntu 22.04, although
  cmake_minimum_required allows them. Use 'if (POLICY CMP0167)'.
* CMAKE_REQUIRED_INCLUDES expects directories, not header names. Setting it
  to 'math.h' injected a bogus -I<scratch>/math.h into every check_*() and
  leaked into the find_package() calls. Dropped, and CMAKE_REQUIRED_LIBRARIES
  is now unset after the checks. config.h is unchanged.
* The Qt3 fallback tested 'AND Qt4_FOUND' instead of 'AND NOT Qt4_FOUND'.
* NeXus regression tests were registered unconditionally and therefore failed
  in a default build. They are gated on 'nexus' now, and the HDF4 based ones
  additionally on HAVE_HDF4.
* HAVE_HDF4 was queried but never defined, i.e. there was no way to switch on
  the HDF4 support that PNeXus/PRunDataHandler/dump_header/musrfit implement.
  Added option(HAVE_HDF4), to be used together with -Dnexus=1. This is not
  academic: the ISIS example data are HDF4 files and test-histo-NeXus only
  passes with -DHAVE_HDF4=1.

Do not use ${ROOT_USE_FILE}:
  It overwrote CMAKE_CXX_STANDARD with ROOT's value and added ROOT's include
  dirs, definitions and recommended compiler flags to *every* target,
  including the Qt applications which do not use ROOT at all. Replaced by an
  explicit equivalent; the C++ standard is now only raised, never silently
  changed. The Qt sub-trees reset flags and include dirs again, mupp/plotter
  puts them back since it does use ROOT. ROOT's flags are kept wherever ROOT
  headers are used, -fsigned-char and -fsized-deallocation are ABI relevant
  there. Verified: the compile flags of all ROOT consuming targets are
  byte-identical to before.

Homebrew header shadowing:
  Boost_INCLUDE_DIRS and FFTW3_INCLUDE are both /opt/homebrew/include on a
  Homebrew system, i.e. the whole 3rd party header tree, and they were passed
  to target_include_directories() with BEFORE - ahead of musrfit's own
  src/include. They now come from the Boost::headers and FFTW3::FFTW3
  imported targets, which contribute them as SYSTEM includes after the
  project's own directories.

macOS:
* mupp: do not set the VERSION property on a MACOSX_BUNDLE target. cmake then
  names the binary Contents/MacOS/mupp-1.1.0 and only leaves a symlink 'mupp'
  beside it, contradicting CFBundleExecutable and not surviving
  zipping/codesigning. This is the reason the symlink had to be created by
  hand so far. VERSION is still set for the non-APPLE build.
* All four app bundles had an empty CFBundleShortVersionString and
  CFBundleVersion; set MACOSX_BUNDLE_SHORT_VERSION_STRING / _BUNDLE_VERSION.
* APPLE is UNIX, so the RPM generator was also active on macOS -> restrict to
  'UNIX AND NOT APPLE'. Likewise the /usr/local/lib rpath, which on Apple
  silicon should be /opt/homebrew/lib; macOS gets its own branch now.
* mupp: -fpermissive is a GCC option, hand it to GCC only.
* musredit: use VERSION_GREATER_EQUAL for the Darwin version icon switch.

Verified on macOS 26 / arm64 with ROOT 6.40.03, Qt 6.11, cmake 4.4: full
build clean in the default configuration, with -DASlibs -DBMWlibs -DBNMRlibs
-DDummyUserFcn (identical list of 55 targets), and with -Dnexus / -DHAVE_HDF4.
ctest shows no regression at any step; no maxLH test fails in any of the three
NeXus configurations.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-25 18:28:30 +02:00
suter_a 901fda9298 adopted ChangeLog. Fixed a minor issue in PTextEdit. Adopted ctests for the new NeXus handling.
Build and Deploy Documentation / build-and-deploy (push) Successful in 29s
2026-02-21 15:32:03 +01:00
suter_a ba939574a4 added musrview png ref test via ctest
Build and Deploy Documentation / build-and-deploy (push) Successful in 27s
2026-02-18 17:07:20 +01:00