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

@ -15,7 +15,7 @@
# Modified by Robert Osfied to enable support for install placements of DCMTK 3.5.4 versions onwards
FIND_PATH( DCMTK_ROOT_INCLUDE_DIR dcmtk/config/osconfig.h
${DCMTK_DIR}/config/include
${DCMTK_DIR}/config/include
${DCMTK_DIR}/include
/usr/local/include/
/usr/include/
@ -23,7 +23,8 @@ FIND_PATH( DCMTK_ROOT_INCLUDE_DIR dcmtk/config/osconfig.h
)
FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
${DCMTK_DIR}/config/include
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/config
${DCMTK_DIR}/config/include
${DCMTK_DIR}/include
/usr/local/include/dcmtk/config
/usr/include/dcmtk/config
@ -31,7 +32,8 @@ FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
)
FIND_PATH( DCMTK_ofstd_INCLUDE_DIR ofstdinc.h
${DCMTK_DIR}/ofstd/include
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/ofstd
${DCMTK_DIR}/ofstd/include
${DCMTK_DIR}/include/ofstd
/usr/local/include/dcmtk/ofstd
/usr/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
@ -98,7 +102,7 @@ FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY dcmimgle
/usr/local/dicom/lib
)
FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
${DCMTK_DIR}/imagectn/libsrc/Release
${DCMTK_DIR}/imagectn/libsrc/
${DCMTK_DIR}/imagectn/libsrc/Debug
@ -109,7 +113,7 @@ FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
/usr/local/dicom/lib
)
FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
${DCMTK_DIR}/dcmnet/libsrc/Release
${DCMTK_DIR}/dcmnet/libsrc/Debug
${DCMTK_DIR}/dcmnet/libsrc/
@ -121,8 +125,8 @@ FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
)
IF( DCMTK_config_INCLUDE_DIR
AND DCMTK_ofstd_INCLUDE_DIR
IF( DCMTK_config_INCLUDE_DIR
AND DCMTK_ofstd_INCLUDE_DIR
AND DCMTK_ofstd_LIBRARY
AND DCMTK_dcmdata_INCLUDE_DIR
AND DCMTK_dcmdata_LIBRARY
@ -162,8 +166,8 @@ IF( DCMTK_config_INCLUDE_DIR
SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
ENDIF( WIN32 )
ENDIF( DCMTK_config_INCLUDE_DIR
AND DCMTK_ofstd_INCLUDE_DIR
ENDIF( DCMTK_config_INCLUDE_DIR
AND DCMTK_ofstd_INCLUDE_DIR
AND DCMTK_ofstd_LIBRARY
AND DCMTK_dcmdata_INCLUDE_DIR
AND DCMTK_dcmdata_LIBRARY

View File

@ -1,15 +1,31 @@
# Locate gdal
# Locate XUL
# This module defines
# XUL_LIBRARIES
# XUL_FOUND, if false, do not try to link to gdal
# XUL_FOUND, if false, do not try to link to gdal
# XUL_INCLUDE_DIR, where to find the headers
#
# $XUL_DIR is an environment variable that would
# correspond to the ./configure --prefix=$XUL_DIR
#
# Created by Robert Osfield.
# Created by Robert Osfield.
FIND_PATH(XUL_INCLUDE_DIR nsEmbedAPI.h
#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
@ -17,7 +33,39 @@ FIND_PATH(XUL_INCLUDE_DIR nsEmbedAPI.h
$ENV{OSGDIR}/include/xulrunner
$ENV{OSGDIR}/include
$ENV{OSGDIR}/xulrunner
$ENV{OSGDIR}
$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
$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
@ -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
@ -48,7 +97,7 @@ FIND_PATH(NSPR_INCLUDE_DIR prtypes.h
$ENV{OSGDIR}/include/nspr
$ENV{OSGDIR}/include
$ENV{OSGDIR}/nspr
$ENV{OSGDIR}
$ENV{OSGDIR}
$ENV{OSG_ROOT}/include/nspr
$ENV{OSG_ROOT}/include
~/Library/Frameworks
@ -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
@ -79,7 +129,7 @@ FIND_PATH(MOZJS_INCLUDE_DIR jsapi.h
$ENV{OSGDIR}/include/mozjs
$ENV{OSGDIR}/include
$ENV{OSGDIR}/mozjs
$ENV{OSGDIR}
$ENV{OSGDIR}
$ENV{OSG_ROOT}/include/mozjs
$ENV{OSG_ROOT}/include
~/Library/Frameworks
@ -102,7 +152,7 @@ FIND_PATH(MOZJS_INCLUDE_DIR jsapi.h
/usr/freeware/include
)
FIND_PATH(XUL_DIR
FIND_PATH(XUL_DIR
NAMES components/appshell.xpt
PATHS
$ENV{OSG_DIR}/lib
@ -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})