1 # **************************************************************************
2 # * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
4 # * Author: The ALICE Off-line Project. *
5 # * Contributors are mentioned in the code where appropriate. *
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 # **************************************************************************
16 # AMORE - used to generate the DAs
17 # Flags are filled using amore-config
19 # - AMORE_STATICLIBS - libraries and linking folders for static build
20 # - AMORE_AUXLIBS - auxiliary libraries for DA
25 set(AMORE_FOUND FALSE)
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})
32 # Checking AMORE version
33 execute_process(COMMAND ${AMORE_CONFIG} --version OUTPUT_VARIABLE AMORE_VERSION ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
35 message(FATAL_ERROR "Error retrieving AMORE version : ${error}")
39 string(STRIP ${AMORE_VERSION} AMORE_VERSION)
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.")
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 )
50 message(FATAL_ERROR "Error retrieving AMORE static libraries : ${error}")
54 string(STRIP ${AMORE_STATICLIBS} AMORE_STATICLIBS)
55 string(REPLACE "\n" " " AMORE_STATICLIBS ${AMORE_STATICLIBS})
56 endif(AMORE_STATICLIBS)
58 # Checking AMORE auxiliary libraries
59 execute_process(COMMAND ${AMORE_CONFIG} --auxlibs-list OUTPUT_VARIABLE AMORE_AUXLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
61 message(FATAL_ERROR "Error retrieving AMORE auxiliary libraries : ${error}")
65 string(STRIP ${AMORE_AUXLIBS} AMORE_AUXLIBS)
68 # Checking AMORE cflags
69 execute_process(COMMAND ${AMORE_CONFIG} --cflags OUTPUT_VARIABLE AMORE_CFLAGS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
71 message(FATAL_ERROR "Error retrieving AMORE cflags : ${error}")
75 string(STRIP ${AMORE_CFLAGS} AMORE_CFLAGS)
78 # Checking AMORE cflags
79 execute_process(COMMAND ${AMORE_CONFIG} --include-dir OUTPUT_VARIABLE AMORE_INCLUDE_DIR ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
81 message(FATAL_ERROR "Error retrieving AMORE include directory : ${error}")
85 string(STRIP ${AMORE_INCLUDE_DIR} AMORE_INCLUDE_DIR)
86 endif(AMORE_INCLUDE_DIR)
88 set(AMORE_DEFINITIONS "-DALI_AMORE")