Commit 6612ceaf authored by Guillaume Pasero's avatar Guillaume Pasero

ENH: add find_package() calls

parent 04100a6f
message(STATUS "Setup Boost ...")
set(proj BOOST)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_BOOST ON)
option(USE_SYSTEM_BOOST " Use a system build of Boost." ${DEFAULT_USE_SYSTEM_BOOST})
mark_as_advanced(USE_SYSTEM_BOOST)
message(STATUS "Setup Boost ...")
if(USE_SYSTEM_BOOST)
# Required
find_package ( Boost
1.35.0
REQUIRED
)
# Optional components
find_package ( Boost
1.35.0
COMPONENTS unit_test_framework
)
message(STATUS " Using Boost system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup cURL ...")
set(proj CURL)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_CURL ON)
option(USE_SYSTEM_CURL " Use a system build of cURL." ${DEFAULT_USE_SYSTEM_CURL})
mark_as_advanced(USE_SYSTEM_CURL)
message(STATUS "Setup cURL ...")
if(USE_SYSTEM_CURL)
find_package ( CURL REQUIRED )
message(STATUS " Using cURL system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup expat ...")
set(proj EXPAT)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_EXPAT OFF)
option(USE_SYSTEM_EXPAT " Use a system build of expat." ${DEFAULT_USE_SYSTEM_EXPAT})
mark_as_advanced(USE_SYSTEM_EXPAT)
message(STATUS "Setup expat ...")
if(USE_SYSTEM_EXPAT)
find_package ( EXPAT REQUIRED )
message(STATUS " Using expat system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup FFTW ...")
set(proj FFTW)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_FFTW OFF)
option(USE_SYSTEM_FFTW " Use a system build of FFTW." ${DEFAULT_USE_SYSTEM_FFTW})
mark_as_advanced(USE_SYSTEM_FFTW)
message(STATUS "Setup FFTW ...")
if(USE_SYSTEM_FFTW)
# TODO : use ITK's FindFFTW
find_package ( FFTW REQUIRED )
message(STATUS " Using FFTW system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup GDAL...")
set(proj GDAL)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_GDAL OFF)
option(USE_SYSTEM_GDAL " Use a system build of GDAL." ${DEFAULT_USE_SYSTEM_GDAL})
mark_as_advanced(USE_SYSTEM_GDAL)
message(STATUS "Setup GDAL...")
if(USE_SYSTEM_GDAL)
find_package ( GDAL REQUIRED )
message(STATUS " Using GDAL system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup GEOS ...")
set(proj GEOS)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_GEOS OFF)
option(USE_SYSTEM_GEOS " Use a system build of GEOS." ${DEFAULT_USE_SYSTEM_GEOS})
mark_as_advanced(USE_SYSTEM_GEOS)
message(STATUS "Setup GEOS ...")
if(USE_SYSTEM_GEOS)
# TODO : FindGEOS.cmake
#find_package ( GEOS REQUIRED )
message(STATUS " Using GEOS system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup libgeotiff...")
set(proj GEOTIFF)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_GEOTIFF OFF)
option(USE_SYSTEM_GEOTIFF " Use a system build of libgeotiff." ${DEFAULT_USE_SYSTEM_GEOTIFF})
mark_as_advanced(USE_SYSTEM_GEOTIFF)
message(STATUS "Setup libgeotiff...")
if(USE_SYSTEM_GEOTIFF)
find_package ( GeoTIFF REQUIRED )
message(STATUS " Using libgeotiff system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup ITK...")
set(proj ITK)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
# Use an external version of ITK by default except on windows (ITK is not packaged in OSGeo4W)
set(DEFAULT_USE_SYSTEM_ITK OFF)
option(USE_SYSTEM_ITK "Use a system build of ITK." ${DEFAULT_USE_SYSTEM_ITK})
mark_as_advanced(USE_SYSTEM_ITK)
message(STATUS "Setup ITK...")
if(USE_SYSTEM_ITK)
find_package ( ITK REQUIRED )
message(STATUS " Using ITK system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup libjpeg...")
set(proj JPEG)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_JPEG OFF)
option(USE_SYSTEM_JPEG " Use a system build of libjpeg." ${DEFAULT_USE_SYSTEM_JPEG})
mark_as_advanced(USE_SYSTEM_JPEG)
message(STATUS "Setup libjpeg...")
if(USE_SYSTEM_JPEG)
find_package ( JPEG REQUIRED )
message(STATUS " Using libjpeg system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup libKML ...")
set(proj LIBKML)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_LIBKML OFF)
option(USE_SYSTEM_LIBKML " Use a system build of libKML." ${DEFAULT_USE_SYSTEM_LIBKML})
mark_as_advanced(USE_SYSTEM_LIBKML)
message(STATUS "Setup libKML ...")
if(USE_SYSTEM_LIBKML)
find_package ( LibKML REQUIRED )
message(STATUS " Using libKML system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup muParser ...")
set(proj MUPARSER)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_MUPARSER OFF)
option(USE_SYSTEM_MUPARSER " Use a system build of muParser." ${DEFAULT_USE_SYSTEM_MUPARSER})
mark_as_advanced(USE_SYSTEM_MUPARSER)
message(STATUS "Setup muParser ...")
if(USE_SYSTEM_MUPARSER)
find_package ( MUPARSER REQUIRED )
message(STATUS " Using muParser system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup muParserX ...")
set(proj MUPARSERX)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_MUPARSERX OFF)
option(USE_SYSTEM_MUPARSERX " Use a system build of muParserX." ${DEFAULT_USE_SYSTEM_MUPARSERX})
mark_as_advanced(USE_SYSTEM_MUPARSERX)
message(STATUS "Setup muParserX ...")
if(USE_SYSTEM_MUPARSERX)
find_package ( MUPARSERX REQUIRED )
message(STATUS " Using muParserX system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup OpenCV...")
set(proj OPENCV)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_OPENCV OFF)
option(USE_SYSTEM_OPENCV "Use a system build of OpenCV." ${DEFAULT_USE_SYSTEM_OPENCV})
mark_as_advanced(USE_SYSTEM_OPENCV)
message(STATUS "Setup OpenCV...")
if(USE_SYSTEM_OPENCV)
find_package ( OpenCV REQUIRED )
message(STATUS " Using OpenCV system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup OpenJpeg...")
set(proj OPENJPEG)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_OPENJPEG OFF)
option(USE_SYSTEM_OPENJPEG " Use a system build of OpenJpeg." ${DEFAULT_USE_SYSTEM_OPENJPEG})
mark_as_advanced(USE_SYSTEM_OPENJPEG)
message(STATUS "Setup OpenJpeg...")
if(USE_SYSTEM_OPENJPEG)
# TODO : FindOpenJPEG.cmake
# find_package ( OpenJPEG REQUIRED )
message(STATUS " Using OpenJpeg system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup OpenThreads ...")
set(proj OPENTHREADS)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_OPENTHREADS OFF)
option(USE_SYSTEM_OPENTHREADS " Use a system build of OpenThread." ${DEFAULT_USE_SYSTEM_OPENTHREADS})
mark_as_advanced(USE_SYSTEM_OPENTHREADS)
message(STATUS "Setup OpenThreads ...")
if(MSVC)
set(USE_SYSTEM_OPENTHREADS OFF)
endif()
if(USE_SYSTEM_OPENTHREADS)
find_package ( OpenThreads REQUIRED )
message(STATUS " Using OpenThread system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup Ossim...")
set(proj OSSIM)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_OSSIM OFF)
message(STATUS "Setup Ossim...")
# OSGeo4W provides an "ossim" package : use it otherwise if it is installed and not used by OTB
# we get conflicts (because OSGeo4W include dir is included for other dependencies
if(WIN32)
set(DEFAULT_USE_SYSTEM_OSSIM ON)
endif()
SETUP_SYSTEM_LIBRARY(PROJECT ${proj} DOC " Use a system build of Ossim.")
#if(WIN32)
# set(DEFAULT_USE_SYSTEM_OSSIM ON)
#endif()
ADD_SYSTEM_LOCATION(PROJECT ${proj} VARIABLES ${proj}_LIBRARY ${proj}_INCLUDE_DIR)
if(USE_SYSTEM_OSSIM)
find_package ( Ossim REQUIRED )
message(STATUS " Using OSSIM system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup pcre...")
set(proj PCRE)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_PCRE ON)
option(USE_SYSTEM_PCRE " Use a system build of pcre." ${DEFAULT_USE_SYSTEM_PCRE})
mark_as_advanced(USE_SYSTEM_PCRE)
message(STATUS "Setup pcre...")
if(USE_SYSTEM_PCRE)
# TODO : FindPCRE.cmake
# find_package ( PCRE REQUIRED )
message(STATUS " Using pcre system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup libpng...")
set(proj PNG)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_PNG ON)
option(USE_SYSTEM_PNG " Use a system build of libtiff." ${DEFAULT_USE_SYSTEM_PNG})
mark_as_advanced(USE_SYSTEM_PNG)
message(STATUS "Setup libpng...")
if(USE_SYSTEM_PNG)
message(STATUS " Using libtiff system version")
find_package ( PNG REQUIRED )
message(STATUS " Using libpng system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup Proj.4 ...")
set(proj PROJ)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_PROJ OFF)
option(USE_SYSTEM_PROJ " Use a system build of Proj.4." ${DEFAULT_USE_SYSTEM_PROJ})
mark_as_advanced(USE_SYSTEM_PROJ)
message(STATUS "Setup Proj.4 ...")
if(USE_SYSTEM_PROJ)
# TODO : FindPROJ.cmake
#find_package ( PROJ REQUIRED )
message(STATUS " Using Proj4 system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup Qt4 ...")
set(proj QT4)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_QT4 ON)
option(USE_SYSTEM_QT4 " Use a system build of Qt4." ${DEFAULT_USE_SYSTEM_QT4})
mark_as_advanced(USE_SYSTEM_QT4)
message(STATUS "Setup Qt4 ...")
if(USE_SYSTEM_QT4)
find_package ( QT4 REQUIRED )
message(STATUS " Using Qt4 system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup SQLite...")
set(proj SQLITE)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_SQLITE OFF)
option(USE_SYSTEM_SQLITE " Use a system build of SQLite." ${DEFAULT_USE_SYSTEM_SQLITE})
mark_as_advanced(USE_SYSTEM_SQLITE)
message(STATUS "Setup SQLite...")
if(USE_SYSTEM_SQLITE)
# TODO
#find_package ( SQLite REQUIRED )
message(STATUS " Using SQLite system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup swig...")
set(proj SWIG)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_SWIG ON)
option(USE_SYSTEM_SWIG " Use a system build of swig." ${DEFAULT_USE_SYSTEM_SWIG})
mark_as_advanced(USE_SYSTEM_SWIG)
message(STATUS "Setup swig...")
if(USE_SYSTEM_SWIG)
find_package ( SWIG REQUIRED )
message(STATUS " Using swig system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup libtiff...")
set(proj TIFF)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_TIFF OFF)
SETUP_SYSTEM_LIBRARY(PROJECT ${proj} DOC " Use a system build of libtiff.")
message(STATUS "Setup libtiff...")
ADD_SYSTEM_LOCATION(PROJECT ${proj} VARIABLES ${proj}_LIBRARY ${proj}_INCLUDE_DIR)
ADD_SYSTEM_PREFIX(PROJECT ${proj})
if(USE_SYSTEM_TIFF)
find_package ( TIFF REQUIRED )
message(STATUS " Using libtiff system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup TinyXML ...")
set(proj TINYXML)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
set(DEFAULT_USE_SYSTEM_TINYXML OFF)
option(USE_SYSTEM_TINYXML " Use a system build of TinyXML." ${DEFAULT_USE_SYSTEM_TINYXML})
mark_as_advanced(USE_SYSTEM_TINYXML)
message(STATUS "Setup TinyXML ...")
if(USE_SYSTEM_TINYXML)
find_package ( TinyXML REQUIRED )
message(STATUS " Using TinyXML system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
......
message(STATUS "Setup Zlib ...")
set(proj ZLIB)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
message(STATUS "Setup Zlib ...")
ADD_SYSTEM_PREFIX(PROJECT ${proj} CMAKE_ALIAS ZLIB_ROOT)
if(USE_SYSTEM_ZLIB)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment