root/OpenSceneGraph/trunk/CMakeModules/FindOSG.cmake @ 9952

Revision 9625, 2.9 kB (checked in by robert, 9 years ago)

Added /lib64 to search paths.

Line 
1# Locate gdal
2# This module defines
3# OSG_LIBRARY
4# OSG_FOUND, if false, do not try to link to gdal
5# OSG_INCLUDE_DIR, where to find the headers
6#
7# $OSG_DIR is an environment variable that would
8# correspond to the ./configure --prefix=$OSG_DIR
9#
10# Created by Robert Osfield.
11
12FIND_PATH(OSG_INCLUDE_DIR osg/Node
13    ${OSG_DIR}/include
14    $ENV{OSG_DIR}/include
15    $ENV{OSG_DIR}
16    $ENV{OSGDIR}/include
17    $ENV{OSGDIR}
18    $ENV{OSG_ROOT}/include
19    NO_DEFAULT_PATH
20)
21
22FIND_PATH(OSG_INCLUDE_DIR osg/Node)
23
24MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
25
26    FIND_LIBRARY("${MYLIBRARY}_DEBUG"
27        NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
28        PATHS
29        ${OSG_DIR}/lib/Debug
30        ${OSG_DIR}/lib
31        $ENV{OSG_DIR}/lib/debug
32        $ENV{OSG_DIR}/lib
33        $ENV{OSG_DIR}
34        $ENV{OSGDIR}/lib
35        $ENV{OSGDIR}
36        $ENV{OSG_ROOT}/lib
37        NO_DEFAULT_PATH
38    )
39
40    FIND_LIBRARY("${MYLIBRARY}_DEBUG"
41        NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
42        PATHS
43        ~/Library/Frameworks
44        /Library/Frameworks
45        /usr/local/lib
46        /usr/local/lib64
47        /usr/lib
48        /usr/lib64
49        /sw/lib
50        /opt/local/lib
51        /opt/csw/lib
52        /opt/lib
53        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
54        /usr/freeware/lib64
55    )
56   
57    FIND_LIBRARY(${MYLIBRARY}
58        NAMES ${MYLIBRARYNAME}
59        PATHS
60        ${OSG_DIR}/lib/Release
61        ${OSG_DIR}/lib
62        $ENV{OSG_DIR}/lib/Release
63        $ENV{OSG_DIR}/lib
64        $ENV{OSG_DIR}
65        $ENV{OSGDIR}/lib
66        $ENV{OSGDIR}
67        $ENV{OSG_ROOT}/lib
68        NO_DEFAULT_PATH
69    )
70
71    FIND_LIBRARY(${MYLIBRARY}
72        NAMES ${MYLIBRARYNAME}
73        PATHS
74        ~/Library/Frameworks
75        /Library/Frameworks
76        /usr/local/lib
77        /usr/local/lib64
78        /usr/lib
79        /usr/lib64
80        /sw/lib
81        /opt/local/lib
82        /opt/csw/lib
83        /opt/lib
84        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
85        /usr/freeware/lib64
86    )
87   
88    IF( NOT ${MYLIBRARY}_DEBUG)
89        IF(MYLIBRARY)
90            SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
91         ENDIF(MYLIBRARY)
92    ENDIF( NOT ${MYLIBRARY}_DEBUG)
93           
94ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)
95
96FIND_OSG_LIBRARY(OSG_LIBRARY osg)
97FIND_OSG_LIBRARY(OSGGA_LIBRARY osgGA)
98FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil)
99FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
100FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
101FIND_OSG_LIBRARY(OSGWIDGET_LIBRARY osgWidget)
102FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
103FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
104FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
105FIND_OSG_LIBRARY(OSGVOLUME_LIBRARY osgVolume)
106FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)
107
108SET(OSG_FOUND "NO")
109IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
110    SET(OSG_FOUND "YES")
111ENDIF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
Note: See TracBrowser for help on using the browser.