From Paul Melis & Robert Osfeild, improvements to find scripts to better handle diffrent installation combinations

This commit is contained in:
Robert Osfield 2009-02-06 15:38:09 +00:00
parent 22e4e63060
commit f5ecacdf4e
2 changed files with 77 additions and 20 deletions

View File

@ -23,6 +23,7 @@ FIND_PATH( DCMTK_ROOT_INCLUDE_DIR dcmtk/config/osconfig.h
)
FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/config
${DCMTK_DIR}/config/include
${DCMTK_DIR}/include
/usr/local/include/dcmtk/config
@ -31,6 +32,7 @@ FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
)
FIND_PATH( DCMTK_ofstd_INCLUDE_DIR ofstdinc.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/ofstd
${DCMTK_DIR}/ofstd/include
${DCMTK_DIR}/include/ofstd
/usr/local/include/dcmtk/ofstd
@ -54,6 +56,7 @@ FIND_LIBRARY( DCMTK_ofstd_LIBRARY ofstd
FIND_PATH( DCMTK_dcmdata_INCLUDE_DIR dctypes.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmdata
${DCMTK_DIR}/dcmdata/include
${DCMTK_DIR}/include/dcmdata
/usr/local/include/dcmtk/dcmdata
@ -77,6 +80,7 @@ FIND_LIBRARY( DCMTK_dcmdata_LIBRARY dcmdata
FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmimage.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmimgle
${DCMTK_DIR}/dcmimgle/include
${DCMTK_DIR}/include/dcmimgle
/usr/local/include/dcmtk/dcmimgle

View File

@ -1,4 +1,4 @@
# Locate gdal
# Locate XUL
# This module defines
# XUL_LIBRARIES
# XUL_FOUND, if false, do not try to link to gdal
@ -9,7 +9,55 @@
#
# Created by Robert Osfield.
#use pkg-config to find various modues
INCLUDE(FindPkgConfig OPTIONAL)
IF(PKG_CONFIG_FOUND)
INCLUDE(FindPkgConfig)
pkg_check_modules(XULRUNNER_XPCOM xulrunner-xpcom<=1.8.9)
pkg_check_modules(XULRUNNER_JS xulrunner-js)
pkg_check_modules(XULRUNNER_NSPR xulrunner-nspr)
pkg_check_modules(XULRUNNER_NSS xulrunner-nss)
ENDIF(PKG_CONFIG_FOUND)
# Added check to make sure that nsIBaseWindow.h is available, as it's not a standard part the of 1.8.x SDK
FIND_PATH(NSIBASEWINDOW_INCLUDE_DIR widget/nsIBaseWindow.h
PATHS ${XULRUNNER_XPCOM_INCLUDE_DIRS}
$ENV{OSG_DIR}/include/xulrunner
$ENV{OSG_DIR}/include
$ENV{OSG_DIR}/xulrunner
$ENV{OSG_DIR}
$ENV{OSGDIR}/include/xulrunner
$ENV{OSGDIR}/include
$ENV{OSGDIR}/xulrunner
$ENV{OSGDIR}
$ENV{OSG_ROOT}/include/xulrunner
$ENV{OSG_ROOT}/include
~/Library/Frameworks
/Library/Frameworks
/usr/local/include/xulrunner
/usr/local/include
/usr/include/xulrunner
/usr/include
/sw/include/xulrunner # Fink
/sw/include # Fink
/opt/local/include/xulrunner # DarwinPorts
/opt/local/include # DarwinPorts
/opt/csw/include/xulrunner # Blastwave
/opt/csw/include # Blastwave
/opt/include/xulrunner
/opt/include
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/xulrunner
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
/usr/freeware/include/xulrunner
/usr/freeware/include
)
FIND_PATH(XUL_INCLUDE_DIR nsEmbedAPI.h
PATHS ${XULRUNNER_XPCOM_INCLUDE_DIRS}
$ENV{OSG_DIR}/include/xulrunner
$ENV{OSG_DIR}/include
$ENV{OSG_DIR}/xulrunner
@ -41,6 +89,7 @@ FIND_PATH(XUL_INCLUDE_DIR nsEmbedAPI.h
)
FIND_PATH(NSPR_INCLUDE_DIR prtypes.h
PATHS ${XULRUNNER_NSPR_INCLUDE_DIRS}
$ENV{OSG_DIR}/include/nspr
$ENV{OSG_DIR}/include
$ENV{OSG_DIR}/nspr
@ -72,6 +121,7 @@ FIND_PATH(NSPR_INCLUDE_DIR prtypes.h
)
FIND_PATH(MOZJS_INCLUDE_DIR jsapi.h
PATHS ${XULRUNNER_JS_INCLUDE_DIRS}
$ENV{OSG_DIR}/include/mozjs
$ENV{OSG_DIR}/include
$ENV{OSG_DIR}/mozjs
@ -129,10 +179,13 @@ FIND_PATH(XUL_DIR
/usr/freeware/lib64
)
MACRO(FIND_XUL_LIBRARY MYLIBRARY MYLIBRARYNAME)
FIND_LIBRARY(${MYLIBRARY}
PATHS ${XULRUNNER_XPCOM_LIBRARY_DIRS}
PATHS ${XULRUNNER_JS_LIBRARY_DIRS}
PATHS ${XULRUNNER_NSPR_LIBRARY_DIRS}
PATHS ${XULRUNNER_NSS_LIBRARY_DIRS}
NAMES ${MYLIBRARYNAME}
PATHS
$ENV{OSG_DIR}/lib
@ -170,13 +223,13 @@ FIND_XUL_LIBRARY(XUL_NSS_LIBRARY nss3)
SET(XUL_FOUND "NO")
IF(XUL_LIBRARY AND XUL_INCLUDE_DIR)
IF(XUL_LIBRARY AND XUL_INCLUDE_DIR AND NSIBASEWINDOW_INCLUDE_DIR)
SET(XUL_FOUND "YES")
SET(XUL_LIBRARIES ${XUL_LIBRARY} ${XUL_MOZJS_LIBRARY} ${XUL_XPCOM_LIBRARY} ${XUL_PLUGIN_LIBRARY} ${XUL_NSS_LIBRARY})
SET(XUL_INCLUDE_DIRS ${XUL_INCLUDE_DIR} ${NSPR_INCLUDE_DIR} ${MOZJS_INCLUDE_DIR})
ENDIF(XUL_LIBRARY AND XUL_INCLUDE_DIR)
ENDIF(XUL_LIBRARY AND XUL_INCLUDE_DIR AND NSIBASEWINDOW_INCLUDE_DIR)
# MESSAGE("XUL_INCLUDE_DIR " ${XUL_INCLUDE_DIR})
# MESSAGE("XUL_LIBRARIES " ${XUL_LIBRARIES})