|
| 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 | + |
1 | 14 | ################################################################################ |
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} |
12 | 16 | ################################################################################ |
13 | 17 |
|
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 | | - |
27 | 18 | message(STATUS "Looking for Atima...") |
28 | 19 |
|
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 |
46 | 45 | ) |
| 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) |
47 | 63 | endif() |
0 commit comments