Commit Graph
21 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 53ec95db6e work on cleaner cmake. 2026-04-15 20:29:55 +02:00
suter_a 4de660788d updated the copyright info.
Build and Deploy Documentation / build-and-deploy (push) Successful in 26s
2026-01-25 07:42:29 +01:00
suter_a 4a20d805dd updated the copyright info. 2025-01-30 11:15:42 +01:00
suter_a 79c8be54bf update of the copyright info. 2024-02-03 19:58:11 +01:00
suter_a fe32046c21 updated the copyright info. 2023-01-05 10:24:31 +01:00
suter_a ae7f1a2168 more work towards a modern cmake. As a first example reworked FFTW3 binding. 2022-07-01 16:18:24 +02:00
suter_a e6e951e8f4 update the copyright info. 2021-03-29 08:22:38 +02:00
suter_a cc8ac60713 by changing the behaviour of the global parts of the class PUserFcnBase from pure virtual default NeedGlobalPart=false, the code can be simplified in many places. 2021-02-26 15:17:41 +01:00
suter_a 10271dab9a update of the copyright info. 2020-04-29 09:05:40 +02:00
suter_a e8982410b0 adopted to the enforced changes by root 6.18.00. 2019-07-01 21:56:50 +02:00
suter_a 795cd75b1e modernized code to C++11 and newer.
This allows to analyze the code by external code analyzers. Since a lot is adopted,
the version is changed to 1.4.3
2019-04-16 15:34:49 +02:00
suter_a 9cd35d1373 added missing include directory. 2019-03-08 16:24:45 +01:00
suter_a dbfeeddf3f Remove automake support
Since the cmake tool chain is now stable, the automake tool chain is removed from musrfit.
This makes documentation and code less cluttered.
2019-03-08 12:50:41 +01:00
suter_a 5908d8791a back from __CLING__ to __CINT__ since the ROOT guys kept __CINT__ even though they are using cling?\! 2017-02-08 10:45:17 +01:00
suter_a ceb7aa6818 changed from legacy rootcint to the new rootcling ROOT dictionary generator. 2017-02-08 09:47:35 +01:00
suter_a 5e28f465a4 replace all __CINT__ by __CLING__. 2017-02-07 16:08:52 +01:00
suter_a 666f2c49c3 added docu for the GbG LF user function 2016-03-29 15:35:45 +02:00
Andreas Suter d5f7d9eb9d added necessary FFTW3 cflags 2016-03-16 07:26:26 +01:00
suter_a 9f38d49773 removed the gsl part all together since it is not thread safe. 2016-03-16 07:10:59 +01:00
suter_a e0e4a1e17e added user function for GbG LF 2016-03-14 11:30:06 +01:00