2007-06-27 01:12:48 +08:00
|
|
|
# Locate gdal
|
|
|
|
# This module defines
|
|
|
|
# OSG_LIBRARY
|
|
|
|
# OSG_FOUND, if false, do not try to link to gdal
|
|
|
|
# OSG_INCLUDE_DIR, where to find the headers
|
|
|
|
#
|
|
|
|
# $OSG_DIR is an environment variable that would
|
|
|
|
# correspond to the ./configure --prefix=$OSG_DIR
|
|
|
|
#
|
|
|
|
# Created by Robert Osfield.
|
|
|
|
|
|
|
|
FIND_PATH(OSG_INCLUDE_DIR osg/Node
|
2009-01-29 23:37:52 +08:00
|
|
|
${OSG_DIR}/include
|
2007-06-27 01:12:48 +08:00
|
|
|
$ENV{OSG_DIR}/include
|
|
|
|
$ENV{OSG_DIR}
|
|
|
|
$ENV{OSGDIR}/include
|
|
|
|
$ENV{OSGDIR}
|
|
|
|
$ENV{OSG_ROOT}/include
|
2009-01-29 23:37:52 +08:00
|
|
|
NO_DEFAULT_PATH
|
2007-06-27 01:12:48 +08:00
|
|
|
)
|
|
|
|
|
2009-01-29 23:37:52 +08:00
|
|
|
FIND_PATH(OSG_INCLUDE_DIR osg/Node)
|
|
|
|
|
2007-06-27 01:12:48 +08:00
|
|
|
MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
|
|
|
|
2009-01-29 23:37:52 +08:00
|
|
|
FIND_LIBRARY("${MYLIBRARY}_DEBUG"
|
|
|
|
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
|
|
|
|
PATHS
|
|
|
|
${OSG_DIR}/lib/Debug
|
2009-11-20 19:18:28 +08:00
|
|
|
${OSG_DIR}/lib64/Debug
|
2009-01-29 23:37:52 +08:00
|
|
|
${OSG_DIR}/lib
|
2009-11-20 19:18:28 +08:00
|
|
|
${OSG_DIR}/lib64
|
2009-01-29 23:37:52 +08:00
|
|
|
$ENV{OSG_DIR}/lib/debug
|
2009-11-20 19:18:28 +08:00
|
|
|
$ENV{OSG_DIR}/lib64/debug
|
2009-01-29 23:37:52 +08:00
|
|
|
$ENV{OSG_DIR}/lib
|
2009-11-20 19:18:28 +08:00
|
|
|
$ENV{OSG_DIR}/lib64
|
2009-01-29 23:37:52 +08:00
|
|
|
$ENV{OSG_DIR}
|
|
|
|
$ENV{OSGDIR}/lib
|
2009-11-20 19:18:28 +08:00
|
|
|
$ENV{OSGDIR}/lib64
|
2009-01-29 23:37:52 +08:00
|
|
|
$ENV{OSGDIR}
|
|
|
|
$ENV{OSG_ROOT}/lib
|
2009-11-20 19:18:28 +08:00
|
|
|
$ENV{OSG_ROOT}/lib64
|
2009-01-29 23:37:52 +08:00
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
FIND_LIBRARY("${MYLIBRARY}_DEBUG"
|
|
|
|
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
|
|
|
|
PATHS
|
|
|
|
~/Library/Frameworks
|
|
|
|
/Library/Frameworks
|
|
|
|
/usr/local/lib
|
2009-02-03 01:16:02 +08:00
|
|
|
/usr/local/lib64
|
2009-01-29 23:37:52 +08:00
|
|
|
/usr/lib
|
2009-02-03 01:16:02 +08:00
|
|
|
/usr/lib64
|
2009-01-29 23:37:52 +08:00
|
|
|
/sw/lib
|
|
|
|
/opt/local/lib
|
|
|
|
/opt/csw/lib
|
|
|
|
/opt/lib
|
|
|
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
|
|
|
/usr/freeware/lib64
|
|
|
|
)
|
|
|
|
|
2007-06-27 01:12:48 +08:00
|
|
|
FIND_LIBRARY(${MYLIBRARY}
|
From David Fries,"We are needing to compile Debug, Release, and MinSizeWithDebInfo, but
currently only Debug appends "d" so the Release and MinSizeWithDebInfo
(and MinSizeRel) all produce the same filenames. This set of changes
lets each build type have a cmake defined string appended, defaulting
to Release none, Debug d, RelWithDebInfo rd, MinSizeRel s. But a user
still can have Release, RelWithDebInfo, and MinSizeRel to produce the
same filenames. It does so by setting the preprocessor define
OSG_LIBRARY_POSTFIX in src/osgDB/CMakeLists.txt to one of the
previously defined cmake variables CMAKE_DEBUG_POSTFIX
CMAKE_RELEASE_POSTFIX CMAKE_RELWITHDEBINFO_POSTFIX
CMAKE_MINSIZEREL_POSTFIX. This method cuts down on the #ifdef _DEBUG
#else preprocessor directives in Registry.cpp as the extension is
always passed in OSG_LIBRARY_POSTFIX. That and __MINGW32__ didn't
have the _DEBUG check which looks like a bug."
2010-03-11 01:19:35 +08:00
|
|
|
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
|
2007-06-27 01:12:48 +08:00
|
|
|
PATHS
|
2009-01-29 23:37:52 +08:00
|
|
|
${OSG_DIR}/lib/Release
|
2009-11-20 19:18:28 +08:00
|
|
|
${OSG_DIR}/lib64/Release
|
2009-01-29 23:37:52 +08:00
|
|
|
${OSG_DIR}/lib
|
2009-11-20 19:18:28 +08:00
|
|
|
${OSG_DIR}/lib64
|
2009-01-29 23:37:52 +08:00
|
|
|
$ENV{OSG_DIR}/lib/Release
|
2009-11-20 19:18:28 +08:00
|
|
|
$ENV{OSG_DIR}/lib64/Release
|
2007-06-27 01:12:48 +08:00
|
|
|
$ENV{OSG_DIR}/lib
|
2009-11-20 19:18:28 +08:00
|
|
|
$ENV{OSG_DIR}/lib64
|
2007-06-27 01:12:48 +08:00
|
|
|
$ENV{OSG_DIR}
|
|
|
|
$ENV{OSGDIR}/lib
|
2009-11-20 19:18:28 +08:00
|
|
|
$ENV{OSGDIR}/lib64
|
2007-06-27 01:12:48 +08:00
|
|
|
$ENV{OSGDIR}
|
|
|
|
$ENV{OSG_ROOT}/lib
|
2009-11-20 19:18:28 +08:00
|
|
|
$ENV{OSG_ROOT}/lib64
|
2009-01-29 23:37:52 +08:00
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
FIND_LIBRARY(${MYLIBRARY}
|
From David Fries,"We are needing to compile Debug, Release, and MinSizeWithDebInfo, but
currently only Debug appends "d" so the Release and MinSizeWithDebInfo
(and MinSizeRel) all produce the same filenames. This set of changes
lets each build type have a cmake defined string appended, defaulting
to Release none, Debug d, RelWithDebInfo rd, MinSizeRel s. But a user
still can have Release, RelWithDebInfo, and MinSizeRel to produce the
same filenames. It does so by setting the preprocessor define
OSG_LIBRARY_POSTFIX in src/osgDB/CMakeLists.txt to one of the
previously defined cmake variables CMAKE_DEBUG_POSTFIX
CMAKE_RELEASE_POSTFIX CMAKE_RELWITHDEBINFO_POSTFIX
CMAKE_MINSIZEREL_POSTFIX. This method cuts down on the #ifdef _DEBUG
#else preprocessor directives in Registry.cpp as the extension is
always passed in OSG_LIBRARY_POSTFIX. That and __MINGW32__ didn't
have the _DEBUG check which looks like a bug."
2010-03-11 01:19:35 +08:00
|
|
|
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
|
2009-01-29 23:37:52 +08:00
|
|
|
PATHS
|
2007-06-27 01:12:48 +08:00
|
|
|
~/Library/Frameworks
|
|
|
|
/Library/Frameworks
|
|
|
|
/usr/local/lib
|
2009-02-03 01:16:02 +08:00
|
|
|
/usr/local/lib64
|
2007-06-27 01:12:48 +08:00
|
|
|
/usr/lib
|
2009-02-03 01:16:02 +08:00
|
|
|
/usr/lib64
|
2007-06-27 01:12:48 +08:00
|
|
|
/sw/lib
|
|
|
|
/opt/local/lib
|
|
|
|
/opt/csw/lib
|
|
|
|
/opt/lib
|
|
|
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
|
|
|
/usr/freeware/lib64
|
|
|
|
)
|
2009-01-29 23:37:52 +08:00
|
|
|
|
|
|
|
IF( NOT ${MYLIBRARY}_DEBUG)
|
|
|
|
IF(MYLIBRARY)
|
|
|
|
SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
|
|
|
|
ENDIF(MYLIBRARY)
|
|
|
|
ENDIF( NOT ${MYLIBRARY}_DEBUG)
|
|
|
|
|
2007-06-27 01:12:48 +08:00
|
|
|
ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)
|
|
|
|
|
|
|
|
FIND_OSG_LIBRARY(OSG_LIBRARY osg)
|
2009-01-29 23:37:52 +08:00
|
|
|
FIND_OSG_LIBRARY(OSGGA_LIBRARY osgGA)
|
2007-06-27 01:12:48 +08:00
|
|
|
FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil)
|
|
|
|
FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
|
|
|
|
FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
|
2009-01-29 23:37:52 +08:00
|
|
|
FIND_OSG_LIBRARY(OSGWIDGET_LIBRARY osgWidget)
|
2007-06-27 01:12:48 +08:00
|
|
|
FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
|
|
|
|
FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
|
|
|
|
FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
|
2009-01-29 23:37:52 +08:00
|
|
|
FIND_OSG_LIBRARY(OSGVOLUME_LIBRARY osgVolume)
|
|
|
|
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)
|
2007-06-27 01:12:48 +08:00
|
|
|
|
|
|
|
SET(OSG_FOUND "NO")
|
|
|
|
IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
|
|
|
|
SET(OSG_FOUND "YES")
|
|
|
|
ENDIF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
|