File: FindOTF2.cmake

package info (click to toggle)
vite 1.2%2Bsvn%2Bgit4.c6c0ce7-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 21,544 kB
  • sloc: cpp: 32,343; makefile: 461; sh: 144; ansic: 67
file content (56 lines) | stat: -rw-r--r-- 1,995 bytes parent folder | download | duplicates (4)
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
#
# Find the OTF2 libraries and include dir
#

# OTF2_INCLUDE_DIR  - Directories to include to use OTF2
# OTF2_LIBRARY    - Files to link against to use OTF2
# OTF2_FOUND        - When false, don't try to use OTF2
#
# OTF2_DIR can be used to make it simpler to find the various include
# directories and compiled libraries when OTF2 was not installed in the
# usual/well-known directories (e.g. because you made an in tree-source
# compilation or because you installed it in an "unusual" directory).
# Just set OTF2_DIR it to your specific installation directory
#
FIND_LIBRARY(OTF2_LIBRARY otf2
  PATHS
  /usr/lib
  /usr/local/lib
  ${OTF2_DIR}/lib
)

IF(OTF2_LIBRARY)
  GET_FILENAME_COMPONENT(OTF2_GUESSED_INCLUDE_DIR_tmp "${OTF2_LIBRARY}" PATH)
  STRING(REGEX REPLACE "lib$" "include" OTF2_GUESSED_INCLUDE_DIR "${OTF2_GUESSED_INCLUDE_DIR_tmp}")
ENDIF(OTF2_LIBRARY)

FIND_PATH( OTF2_INCLUDE_DIR otf2/otf2.h
  PATHS
  ${OTF2_GUESSED_INCLUDE_DIR}
  ${OTF2_DIR}/include
  /usr/include
  /usr/local/include
  ${CMAKE_SOURCE_DIR}/externals/otf2/include/
)

IF( OTF2_INCLUDE_DIR )
  IF( OTF2_LIBRARY )
    SET( OTF2_FOUND "YES" )
    MARK_AS_ADVANCED( OTF2_DIR )
    MARK_AS_ADVANCED( OTF2_INCLUDE_DIR )
    MARK_AS_ADVANCED( OTF2_LIBRARY )
  ENDIF( OTF2_LIBRARY )
ENDIF( OTF2_INCLUDE_DIR )

IF( NOT OTF2_FOUND )
  MESSAGE("OTF2 installation was not found. Please provide OTF2_DIR:")
  MESSAGE("  - through the GUI when working with ccmake, ")
  MESSAGE("  - as a command line argument when working with cmake e.g. ")
  MESSAGE("    cmake .. -DOTF2_DIR:PATH=/usr/local/otf ")
  MESSAGE("Note: the following message is triggered by cmake on the first ")
  MESSAGE("    undefined necessary PATH variable (e.g. OTF2_INCLUDE_DIR).")
  MESSAGE("    Providing OTF2_DIR (as above described) is probably the")
  MESSAGE("    simplest solution unless you have a really customized/odd")
  MESSAGE("    OTF2 installation...")
  SET(OTF2_DIR "" CACHE PATH "Root of OTF2 install tree." )
ENDIF( NOT OTF2_FOUND )