]> git.uio.no Git - u/mrichter/AliRoot.git/blame - cmake/FindAMORE.cmake
doxy: do not show whitespace diffs on bulk edit
[u/mrichter/AliRoot.git] / cmake / FindAMORE.cmake
CommitLineData
f82bfa66 1# **************************************************************************
2# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
3# * *
4# * Author: The ALICE Off-line Project. *
5# * Contributors are mentioned in the code where appropriate. *
6# * *
7# * Permission to use, copy, modify and distribute this software and its *
8# * documentation strictly for non-commercial purposes is hereby granted *
9# * without fee, provided that the above copyright notice appears in all *
10# * copies and that both the copyright notice and this permission notice *
11# * appear in the supporting documentation. The authors make no claims *
12# * about the suitability of this software for any purpose. It is *
13# * provided "as is" without express or implied warranty. *
14# **************************************************************************
6db31708 15
f82bfa66 16# AMORE - used to generate the DAs
17# Flags are filled using amore-config
18# - AMORE_VERSION
19# - AMORE_STATICLIBS - libraries and linking folders for static build
20# - AMORE_AUXLIBS - auxiliary libraries for DA
21# - AMORE_DEFINITIONS
48bb5b02 22# - AMORE_CFLAGS
23# - AMORE_INCLUDE_DIR
f82bfa66 24
25set(AMORE_FOUND FALSE)
6db31708 26
6db31708 27if(AMORE_CONFIG)
ec8c8ea6 28 # Setting ROOTSYS environment variable for the amore-config to find root-config
29 # The variable is unset after the Find is finished
30 set(ENV{ROOTSYS} ${ROOTSYS})
31
f82bfa66 32 # Checking AMORE version
33 execute_process(COMMAND ${AMORE_CONFIG} --version OUTPUT_VARIABLE AMORE_VERSION ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
34 if(error)
35 message(FATAL_ERROR "Error retrieving AMORE version : ${error}")
36 endif(error)
ec8c8ea6 37
38 if(AMORE_VERSION)
39 string(STRIP ${AMORE_VERSION} AMORE_VERSION)
40 endif(AMORE_VERSION)
f82bfa66 41
42 # Extract major, minor, and patch versions from
43# string(REGEX REPLACE "^([0-9]+)\\.[0-9]+" "\\1" DATE_VERSION_MAJOR "${DATE_VERSION}")
44# string(REGEX REPLACE "^[0-9]+\\.([0-9]+)" "\\1" DATE_VERSION_MINOR "${DATE_VERSION}")
45 message(STATUS "AMORE version ${AMORE_VERSION} found.")
46
47 # Checking AMORE static libraries
48 execute_process(COMMAND ${AMORE_CONFIG} --ldflags-da-static OUTPUT_VARIABLE AMORE_STATICLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
49 if(error)
50 message(FATAL_ERROR "Error retrieving AMORE static libraries : ${error}")
51 endif(error)
ec8c8ea6 52
53 if(AMORE_STATICLIBS)
54 string(STRIP ${AMORE_STATICLIBS} AMORE_STATICLIBS)
55 string(REPLACE "\n" " " AMORE_STATICLIBS ${AMORE_STATICLIBS})
56 endif(AMORE_STATICLIBS)
f82bfa66 57
58 # Checking AMORE auxiliary libraries
46e377fb 59 execute_process(COMMAND ${AMORE_CONFIG} --auxlibs-list OUTPUT_VARIABLE AMORE_AUXLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
f82bfa66 60 if(error)
61 message(FATAL_ERROR "Error retrieving AMORE auxiliary libraries : ${error}")
62 endif(error)
ec8c8ea6 63
64 if(AMORE_AUXLIBS)
65 string(STRIP ${AMORE_AUXLIBS} AMORE_AUXLIBS)
66 endif(AMORE_AUXLIBS)
f82bfa66 67
48bb5b02 68 # Checking AMORE cflags
69 execute_process(COMMAND ${AMORE_CONFIG} --cflags OUTPUT_VARIABLE AMORE_CFLAGS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
70 if(error)
71 message(FATAL_ERROR "Error retrieving AMORE cflags : ${error}")
72 endif(error)
73
74 if(AMORE_CFLAGS)
75 string(STRIP ${AMORE_CFLAGS} AMORE_CFLAGS)
76 endif(AMORE_CFLAGS)
77
78 # Checking AMORE cflags
79 execute_process(COMMAND ${AMORE_CONFIG} --include-dir OUTPUT_VARIABLE AMORE_INCLUDE_DIR ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
80 if(error)
81 message(FATAL_ERROR "Error retrieving AMORE include directory : ${error}")
82 endif(error)
83
84 if(AMORE_INCLUDE_DIR)
85 string(STRIP ${AMORE_INCLUDE_DIR} AMORE_INCLUDE_DIR)
86 endif(AMORE_INCLUDE_DIR)
87
f82bfa66 88 set(AMORE_DEFINITIONS "-DALI_AMORE")
89 set(AMORE_FOUND TRUE)
ec8c8ea6 90 unset(ENV{ROOTSYS})
f82bfa66 91
6db31708 92endif(AMORE_CONFIG)