File: FindLIBLAS.cmake

package info (click to toggle)
openscenegraph 3.6.5%2Bdfsg1-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 40,028 kB
  • sloc: cpp: 392,065; ansic: 21,495; java: 1,020; yacc: 548; makefile: 430; objc: 406; xml: 155; lex: 151; javascript: 34
file content (108 lines) | stat: -rw-r--r-- 2,834 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#---
# File: FindLIBLAS.cmake
#
# Find the native LIBLAS includes and library
#
#  LIBLAS_INCLUDE_DIRS - where to find liblas's includes.
#  LIBLAS_LIBRARIES    - List of libraries when using liblas.
#  LIBLAS_FOUND        - True if liblas found.
#---


# Set the include dir:
find_path(LIBLAS_INCLUDE_DIR liblas/liblas.hpp)

# Macro for setting libraries:
macro(FIND_LIBLAS_LIBRARY MYLIBRARY MYLIBRARYNAME)

   find_library(
     "${MYLIBRARY}_DEBUG"
     NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
     PATHS
     ${LIBLAS_DIR}/lib/Debug
     ${LIBLAS_DIR}/lib64/Debug
     ${LIBLAS_DIR}/lib
     ${LIBLAS_DIR}/lib64
     $ENV{LIBLAS_DIR}/lib/debug
     $ENV{LIBLAS_DIR}/lib64/debug
     NO_DEFAULT_PATH
   )

   find_library(
     "${MYLIBRARY}_DEBUG"
     NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
     PATHS
     ~/Library/Frameworks
     /Library/Frameworks
     /usr/local/lib
     /usr/local/lib64
     /usr/lib
     /usr/lib64
     /sw/lib
     /opt/local/lib
     /opt/csw/lib
     /opt/lib
     [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;LIBLAS_ROOT]/lib
     /usr/freeware/lib64
   )

   find_library(
     ${MYLIBRARY}
     NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
     PATHS
     ${LIBLAS_DIR}/lib/Release
     ${LIBLAS_DIR}/lib64/Release
     ${LIBLAS_DIR}/lib
     ${LIBLAS_DIR}/lib64
     $ENV{LIBLAS_DIR}/lib/Release
     $ENV{LIBLAS_DIR}/lib64/Release
     $ENV{LIBLAS_DIR}/lib
     $ENV{LIBLAS_DIR}/lib64
     $ENV{LIBLAS_DIR}
     $ENV{LIBLASDIR}/lib
     $ENV{LIBLASDIR}/lib64
     $ENV{LIBLASDIR}
     $ENV{LIBLAS_ROOT}/lib
     $ENV{LIBLAS_ROOT}/lib64
     NO_DEFAULT_PATH
   )

   find_library(
     ${MYLIBRARY}
     NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
     PATHS
     ~/Library/Frameworks
     /Library/Frameworks
     /usr/local/lib
     /usr/local/lib64
     /usr/lib
     /usr/lib64
     /sw/lib
     /opt/local/lib
     /opt/csw/lib
     /opt/lib
     [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;LIBLAS_ROOT]/lib
     /usr/freeware/lib64
   )

   if( NOT ${MYLIBRARY}_DEBUG )
     if( MYLIBRARY )
       set( ${MYLIBRARY}_DEBUG ${MYLIBRARY} )
     endif(MYLIBRARY)
   endif( NOT ${MYLIBRARY}_DEBUG )

endmacro(FIND_LIBLAS_LIBRARY LIBRARY LIBRARYNAME)

FIND_LIBLAS_LIBRARY(LIBLAS_LIBRARY las)

set(LIBLAS_FOUND "NO")
if(LIBLAS_LIBRARY AND LIBLAS_INCLUDE_DIR)
    FIND_PACKAGE(Boost) # used by LIBLAS
    if(Boost_FOUND)
        set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} )
        set(LIBLAS_FOUND "YES")
        if(WIN32)
            link_directories(${Boost_LIBRARY_DIRS})
        endif()
    endif()
endif()