Skip to content

Commit 33d438b

Browse files
committed
feat(atima):Recover catima for compilation
1 parent e9f3883 commit 33d438b

8 files changed

Lines changed: 97 additions & 93 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,11 @@ else(EPICS_FOUND)
457457
endif(EPICS_FOUND)
458458

459459
find_package(Atima)
460-
if(Atima_FOUND)
461-
set(atima_summary "${BGreen}YES${CR} ${BMagenta}${R3BROOT_SOURCE_DIR}/atima/${CR}")
462-
else(Atima_FOUND)
460+
if(ATIMA_FOUND)
461+
set(atima_summary "${BGreen}YES${CR} ${BMagenta}$ENV{ATIMAPATH}${CR}")
462+
else(ATIMA_FOUND)
463463
set(atima_summary "${BYellow}NO${CR}")
464-
endif(Atima_FOUND)
464+
endif(ATIMA_FOUND)
465465

466466
if(EXISTS "${R3BROOT_SOURCE_DIR}/sofia/")
467467
message("Building SOFIA framework...")
@@ -581,6 +581,9 @@ if(NOT MODULE)
581581
add_subdirectory(musli)
582582
add_subdirectory(analysis)
583583
add_subdirectory(actaf)
584+
if(ATIMA_FOUND)
585+
add_subdirectory(atima)
586+
endif(ATIMA_FOUND)
584587
if(WITH_SOFIA)
585588
add_subdirectory(sofia)
586589
endif(WITH_SOFIA)
@@ -600,9 +603,6 @@ if(NOT MODULE)
600603
#================================================================================
601604
# TODO: Since other dependencies still use the old cmake configurations, include(ROOTMacros) has to be used. Please change them using CMake targets ASAP.
602605
include(ROOTMacros)
603-
if(Atima_FOUND)
604-
add_subdirectory(atima)
605-
endif(Atima_FOUND)
606606
if(EXISTS "${PROJECT_SOURCE_DIR}/R3BFileSource")
607607
add_subdirectory(R3BFileSource)
608608
endif(EXISTS "${PROJECT_SOURCE_DIR}/R3BFileSource")

atima/AtimaLinkDef.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// clang-format off
22

33
/******************************************************************************
4-
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
5-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
4+
* Copyright (C) 2020 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
5+
* Copyright (C) 2020-2026 Members of R3B Collaboration *
66
* *
77
* This software is distributed under the terms of the *
88
* GNU General Public Licence (GPL) version 3, *

atima/CMakeLists.txt

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##############################################################################
2-
# Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
3-
# Copyright (C) 2019-2025 Members of R3B Collaboration #
2+
# Copyright (C) 2020 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
3+
# Copyright (C) 2020-2026 Members of R3B Collaboration #
44
# #
55
# This software is distributed under the terms of the #
66
# GNU General Public Licence (GPL) version 3, #
@@ -11,34 +11,28 @@
1111
# or submit itself to any jurisdiction. #
1212
##############################################################################
1313

14-
# Create a library called "libR3BAtima" which includes the source files
15-
#given in # the array . # The extension is already found. Any number
16-
#of sources could be listed here.
17-
18-
Set(SYSTEM_INCLUDE_DIRECTORIES
19-
${SYSTEM_INCLUDE_DIRECTORIES}
20-
${BASE_INCLUDE_DIRECTORIES}
21-
)
22-
23-
set(INCLUDE_DIRECTORIES
24-
${R3BROOT_SOURCE_DIR}/atima
25-
)
26-
include_directories(${INCLUDE_DIRECTORIES} ${SYSTEM_INCLUDE_DIRECTORIES})
27-
28-
set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ${FAIRROOT_LIBRARY_DIR})
29-
link_directories(${LINK_DIRECTORIES})
30-
3114
set(SRCS
3215
R3BAtima.cxx
3316
R3BAtimaCache.cxx
3417
)
3518

36-
CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}")
37-
38-
Set(LINKDEF AtimaLinkDef.h)
39-
Set(LIBRARY_NAME R3BAtima)
40-
Set(DEPENDENCIES Atima::Atima FairLogger::FairLogger)
19+
set(HEADERS
20+
R3BAtima.h
21+
R3BAtimaCache.h
22+
)
4123

42-
GENERATE_LIBRARY()
24+
add_library_with_dictionary(
25+
LIBNAME
26+
R3BAtima
27+
LINKDEF
28+
AtimaLinkDef.h
29+
HEADERS
30+
${HEADERS}
31+
SRCS
32+
${SRCS}
33+
INCLUDEDIRS
34+
${CMAKE_CURRENT_SOURCE_DIR}
35+
DEPENDENCIES
36+
Atima::Atima R3BBase)
4337

4438
add_subdirectory(test)

atima/R3BAtima.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
2+
* Copyright (C) 2020 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3+
* Copyright (C) 2020-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -11,8 +11,7 @@
1111
* or submit itself to any jurisdiction. *
1212
******************************************************************************/
1313

14-
#ifndef R3BATIMA_H
15-
#define R3BATIMA_H
14+
#pragma once
1615

1716
#include "Rtypes.h"
1817

@@ -21,7 +20,6 @@
2120

2221
namespace R3BAtima
2322
{
24-
2523
struct MaterialCompound
2624
{
2725
MaterialCompound(const Double_t mass_u = 1, const Double_t charge_e = 1)
@@ -102,5 +100,3 @@ namespace R3BAtima
102100
Double_t tarThickness_mm);
103101

104102
}; // namespace R3BAtima
105-
106-
#endif

atima/R3BAtimaCache.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
2+
* Copyright (C) 2020 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3+
* Copyright (C) 2020-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -13,7 +13,7 @@
1313

1414
#include "R3BAtimaCache.h"
1515

16-
#include "FairLogger.h"
16+
#include <FairLogger.h>
1717

1818
#include <algorithm>
1919
#include <exception>

atima/R3BAtimaCache.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
2+
* Copyright (C) 2020 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3+
* Copyright (C) 2020-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -11,11 +11,10 @@
1111
* or submit itself to any jurisdiction. *
1212
******************************************************************************/
1313

14-
#ifndef R3BATIMACACHE_H
15-
#define R3BATIMACACHE_H
14+
#pragma once
1615

17-
#include "TGraph2D.h"
18-
#include "TString.h"
16+
#include <TGraph2D.h>
17+
#include <TString.h>
1918

2019
#include "R3BAtima.h"
2120

@@ -76,4 +75,3 @@ namespace R3BAtima
7675
mutable TGraph2D fG_InterpolatedTargetThickness;
7776
};
7877
} // namespace R3BAtima
79-
#endif

cmake/modules/FindAtima.cmake

Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,63 @@
1+
##############################################################################
2+
# Copyright (C) 2020 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
3+
# Copyright (C) 2020-2026 Members of R3B Collaboration #
4+
# #
5+
# This software is distributed under the terms of the #
6+
# GNU General Public Licence (GPL) version 3, #
7+
# copied verbatim in the file "LICENSE". #
8+
# #
9+
# In applying this license GSI does not waive the privileges and immunities #
10+
# granted to it by virtue of its status as an Intergovernmental Organization #
11+
# or submit itself to any jurisdiction. #
12+
##############################################################################
13+
114
################################################################################
2-
# Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
3-
# Copyright (C) 2019-2025 Members of R3B Collaboration #
4-
# #
5-
# This software is distributed under the terms of the #
6-
# GNU General Public Licence (GPL) version 3, #
7-
# copied verbatim in the file "LICENSE". #
8-
# #
9-
# In applying this license GSI does not waive the privileges and immunities #
10-
# granted to it by virtue of its status as an Intergovernmental Organization #
11-
# or submit itself to any jurisdiction. #
15+
# FindAtima.cmake - Find module for CaTima / Atima using $ENV{ATIMAPATH}
1216
################################################################################
1317

14-
# FindAtima.cmake
15-
#
16-
# Finds the Atima library
17-
#
18-
# This will define the following variables
19-
#
20-
# Atima_FOUND Atima_LIBRARY
21-
#
22-
# and the following imported targets
23-
#
24-
# Atima::Atima
25-
#
26-
2718
message(STATUS "Looking for Atima...")
2819

29-
find_library(Atima_LIBRARY
30-
NAMES Atima
31-
HINTS $ENV{ATIMAPATH})
32-
33-
include(FindPackageHandleStandardArgs)
34-
find_package_handle_standard_args(Atima
35-
FOUND_VAR
36-
Atima_FOUND
37-
REQUIRED_VARS
38-
Atima_LIBRARY)
39-
40-
if(Atima_FOUND AND NOT TARGET Atima::Atima)
41-
message(STATUS "Found Atima: ${Atima_LIBRARY}")
42-
add_library(Atima::Atima UNKNOWN IMPORTED)
43-
set_target_properties(Atima::Atima PROPERTIES
44-
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
45-
IMPORTED_LOCATION "${Atima_LIBRARY}"
20+
if(NOT DEFINED ENV{ATIMAPATH})
21+
message(" - Environment variable ATIMAPATH is not set.")
22+
else()
23+
set(CATIMA_ROOT $ENV{ATIMAPATH})
24+
25+
find_path(Atima_INCLUDE_DIR
26+
NAMES catima/catima.h
27+
HINTS ${CATIMA_ROOT}/include
28+
PATH_SUFFIXES catima
29+
DOC "Path to CaTima include directory"
30+
)
31+
32+
find_library(Atima_LIBRARY_SHARED
33+
NAMES catima libcatima
34+
HINTS ${CATIMA_ROOT}/lib
35+
DOC "Path to CaTima shared library"
36+
)
37+
38+
if(Atima_LIBRARY_SHARED)
39+
set(Atima_LIBRARY ${Atima_LIBRARY_SHARED})
40+
endif()
41+
42+
include(FindPackageHandleStandardArgs)
43+
find_package_handle_standard_args(Atima
44+
REQUIRED_VARS Atima_LIBRARY Atima_INCLUDE_DIR
4645
)
46+
47+
if(ATIMA_FOUND AND NOT TARGET Atima::Atima)
48+
add_library(Atima::Atima UNKNOWN IMPORTED GLOBAL)
49+
set_target_properties(Atima::Atima PROPERTIES
50+
IMPORTED_LOCATION "${Atima_LIBRARY}"
51+
INTERFACE_INCLUDE_DIRECTORIES "${Atima_INCLUDE_DIR}"
52+
INTERFACE_LINK_LIBRARIES "${Atima_LIBRARY}"
53+
)
54+
endif()
55+
endif()
56+
57+
message(" - ${Cyan}ATIMAPATH${CR} = ${BGreen}$ENV{ATIMAPATH}${CR}")
58+
message(" - ${Cyan}Atima_INCLUDE_DIR${CR} = ${BGreen}${Atima_INCLUDE_DIR}${CR}")
59+
message(" - ${Cyan}Atima_LIBRARY${CR} = ${BGreen}${Atima_LIBRARY}${CR}")
60+
61+
if(ATIMA_FOUND)
62+
add_definitions(-DWITH_ATIMA)
4763
endif()

cmake/modules/Finducesb.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
# Check out the git repository and compile: #
1717
# git clone http://fy.chalmers.se/~f96hajo/ucesb/ucesb.git #
1818
# cd ucesb #
19-
# make -j empty/empty #
20-
# Make sure to use the same ROOT version as for R3BROOT #
19+
# make -j empty/empty #
20+
# Make sure to use the same ROOT version as for R3BROOT #
2121
# After installation export an environment variable UCESB_DIR #
2222
# which points to the 'unpacker' directory you have checked out. #
2323
# More information: http://fy.chalmers.se/~f96hajo/ucesb/ #

0 commit comments

Comments
 (0)