File: FindARMPL.cmake

package info (click to toggle)
metview 5.26.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 614,288 kB
  • sloc: cpp: 560,215; ansic: 44,633; xml: 19,933; f90: 17,905; sh: 7,269; python: 5,565; yacc: 2,318; lex: 1,372; perl: 701; makefile: 87
file content (64 lines) | stat: -rw-r--r-- 2,087 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# (C) Copyright 2011- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation
# nor does it submit to any jurisdiction.

# - Try to find ARMPL
# Once done this will define
#
#  ARMPL_FOUND         - system has ARM Performance Libraries
#  ARMPL_INCLUDE_DIRS  - the ARMPL include directories
#  ARMPL_LIBRARIES     - link these to use ARMPL
#
# The following paths will be searched with priority if set in CMake or env
#
#  ARMPLROOT           - root directory of the ARMPL installation
#  ARMPL_PATH          - root directory of the ARMPL installation
#  ARMPL_ROOT          - root directory of the ARMPL installation

option( ARMPL_PARALLEL "if armpl shoudl be parallel" OFF )

if( ARMPL_PARALLEL )

  set( __armpl_lib_suffix  "_mp" )

  find_package(Threads)

else()

  set( __armpl_lib_suffix "" )

endif()

# Search with priority for ARMPLROOT, ARMPL_PATH and ARMPL_ROOT if set in CMake or env
find_path(ARMPL_INCLUDE_DIR armpl.h
	  PATHS ${ARMPLROOT} ${ARMPL_PATH} ${ARMPL_ROOT} ${ARMPL_DIR} $ENV{ARMPLROOT} $ENV{ARMPL_PATH} $ENV{ARMPL_ROOT} $ENV{ARMPL_DIR}
          PATH_SUFFIXES include NO_DEFAULT_PATH)

find_path(ARMPL_INCLUDE_DIR armpl.h
          PATH_SUFFIXES include)

if( ARMPL_INCLUDE_DIR ) # use include dir to find libs

  set( ARMPL_INCLUDE_DIRS ${ARMPL_INCLUDE_DIR} )

  find_library( ARMPL_LIB
                PATHS ${ARMPLROOT} ${ARMPL_PATH} ${ARMPL_ROOT} ${ARMPL_DIR} $ENV{ARMPLROOT} $ENV{ARMPL_PATH} $ENV{ARMPL_ROOT} $ENV{ARMPL_DIR}
		PATH_SUFFIXES "lib" 
                NAMES armpl_lp64${__armpl_lib_suffix} )

  if( ARMPL_LIB )
    set( ARMPL_LIBRARIES ${ARMPL_LIB} )
  endif()

endif()

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args( ARMPL DEFAULT_MSG
                                   ARMPL_LIBRARIES ARMPL_INCLUDE_DIRS )

mark_as_advanced( ARMPL_INCLUDE_DIR ARMPL_LIB )