Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CMakeLists #2

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open

Update CMakeLists #2

wants to merge 33 commits into from

Conversation

unmovingcastle
Copy link

@unmovingcastle unmovingcastle commented Dec 27, 2024

A PR to go with pueoBuilder's CleanUp branch
and libRootFftwWrapper's updateCMake branch
and NiceMC's updateCMake branch
and pueoSim's updateCMake branch
and pueo-data's updateCMake branch
and pueoEvent's updateCMake branch

THESE PRs NEED TO BE MERGED SIMULTANEOUSLY

general

  1. Using target_*() commands whenever possible to avoid adding things globally.
  2. Packaged the project for downstream repositories to find_package() and obtain the PUBLIC compiler flags/definitions, header files, and library automatically when they link against AntarcticaRoot; resources:
    modern way to package things
  3. now using find_package(CONFIG) mode and linking through Namespace::target wherever possible; e.g. ZLIB::ZLIB (although not sure if zlib is actually needed).
  4. Removed explicit find_package(FFTW): not used by AntarcticaRoot (although still linking against fftw libraries through upstream RootFftwWrapper because it is set to PUBLIC there)
  5. Separated build tree and install tree include paths so that downstream find_package() can correctly identify AntarcticaRoot's include path automatically; AntarcticaRoot's header files now grouped together in a single directory in the install tree

compiler flags and definitions

  1. USE_FFT_TOOLS removed (not used by any repo)
  2. Preprocessor macroUSE_GEOGRAPHIC_LIB compiled and is set to PRIVATE at the moment (because downstream projects don't seem to use these compiler definitions)
  3. On the other hand, USE_HEALPIX seems broken although set to PUBLIC (NiceMC could need this). That said, USE_HEALPIX doesn't seem to be utilized by AntarcticaRoot's source code
  4. -g and -O2 removed since these are determined by CMake build types
  5. Only use warnings flags -Wall and -Wextra in Debug mode; resources:
    Modern CMake generator expression
  6. removed option FORCE_OLD_GPP_ABI; the associated compiler flag should come from upstream RootFftwWrapper (ie. if upstream is built with this option, the flag will propagate)
  7. -march=native now comes from upstream RootFftwWrapper's NATIVE_ARCH option (ie. if upstream is built with this option, the flag will propagate)

CERN ROOT

  1. Checked all #include <> directives in the source files to determine the ROOT::<targets> to link against (instead of linking against the entire ROOT library ${ROOT_LIBRARIES}). See CERN ROOT's CMake project example. The checklist is stored in cmake/rootLibList.txt.
  2. Automated CERN ROOT dictionary generation to reduced a few lines; resources:
    CERN ROOT Forum
    Modern CMake CERN ROOT section
  3. Linking against ROOT::<targets> PRIVATEly to avoid redundant linking downstream.

jason yao added 26 commits December 19, 2024 05:54
it probably needs to be updated somehow
-g -Wall -Wextra and such are already PUBLIC in RootFftwWrapper and so
they propagate here
as per the original cmakelists
This is done through find_dependency(...) in the config file.
This is needed for downstream projects to find RootFftwWrapper via this
package.
@unmovingcastle unmovingcastle changed the title Update c make Update CMakeLists Dec 27, 2024
jason yao added 6 commits December 30, 2024 21:52
not used by this repo either
These flags were originally intended to be used in RootFftwWrapper (see its Master branch)
but now if I use them in RootFftwWrapper, peuoSim seg faults.

Also, if I put these things in AntarcticaRoot, everything seems fine.
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.

None yet

1 participant