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 # Checking AMORE version
29 execute_process(COMMAND ${AMORE_CONFIG} --version OUTPUT_VARIABLE AMORE_VERSION ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
31 message(FATAL_ERROR "Error retrieving AMORE version : ${error}")
33 string(STRIP ${AMORE_VERSION} AMORE_VERSION)
35 # Extract major, minor, and patch versions from
36 # string(REGEX REPLACE "^([0-9]+)\\.[0-9]+" "\\1" DATE_VERSION_MAJOR "${DATE_VERSION}")
37 # string(REGEX REPLACE "^[0-9]+\\.([0-9]+)" "\\1" DATE_VERSION_MINOR "${DATE_VERSION}")
38 message(STATUS "AMORE version ${AMORE_VERSION} found.")
40 # Checking AMORE static libraries
41 execute_process(COMMAND ${AMORE_CONFIG} --ldflags-da-static OUTPUT_VARIABLE AMORE_STATICLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
43 message(FATAL_ERROR "Error retrieving AMORE static libraries : ${error}")
45 string(STRIP ${AMORE_STATICLIBS} AMORE_STATICLIBS)
46 string(REPLACE "\n" " " AMORE_STATICLIBS ${AMORE_STATICLIBS})
48 # Checking AMORE auxiliary libraries
49 execute_process(COMMAND ${AMORE_CONFIG} --auxlibs OUTPUT_VARIABLE AMORE_AUXLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
51 message(FATAL_ERROR "Error retrieving AMORE auxiliary libraries : ${error}")
53 string(STRIP ${AMORE_AUXLIBS} AMORE_AUXLIBS)
55 # Checking AMORE cflags
56 execute_process(COMMAND ${AMORE_CONFIG} --cflags OUTPUT_VARIABLE AMORE_CFLAGS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
58 message(FATAL_ERROR "Error retrieving AMORE cflags : ${error}")
62 string(STRIP ${AMORE_CFLAGS} AMORE_CFLAGS)
65 # Checking AMORE cflags
66 execute_process(COMMAND ${AMORE_CONFIG} --include-dir OUTPUT_VARIABLE AMORE_INCLUDE_DIR ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
68 message(FATAL_ERROR "Error retrieving AMORE include directory : ${error}")
72 string(STRIP ${AMORE_INCLUDE_DIR} AMORE_INCLUDE_DIR)
73 endif(AMORE_INCLUDE_DIR)
76 set(AMORE_DEFINITIONS "-DALI_AMORE")