Commit 56ac7f30 authored by Guillaume Pasero's avatar Guillaume Pasero

ENH: superbuild: end refactoring

parent 98d4275b
......@@ -134,5 +134,9 @@ else()
endif() #end else MSVC
set(Boost_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(Boost_LIBRARY_DIR ${SB_INSTALL_PREFIX}/lib)
endif()
endif()
......@@ -11,6 +11,7 @@ if(USE_SYSTEM_CURL)
message(STATUS " Using cURL system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using cURL SuperBuild version")
# declare dependencies
set(${proj}_DEPENDENCIES ZLIB)
......@@ -18,7 +19,9 @@ else()
# set proj back to its original value
set(proj CURL)
ADD_SUPERBUILD_CONFIG_VAR(ZLIB_ROOT)
if(USE_SYSTEM_GEOS)
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_SB_ROOT)
endif()
#TODO: add openssl and other dependencies
if(MSVC)
......@@ -45,15 +48,22 @@ else()
INSTALL_DIR ${SB_INSTALL_PREFIX}
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
-DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
-DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_CURL_EXE:BOOL=ON
-DBUILD_CURL_TESTS:BOOL=OFF
${CURL_SB_ZLIB_CONFIG}
${CURL_SB_CONFIG}
DEPENDS ${${proj}_DEPENDENCIES}
)
endif()
message(STATUS " Using cURL SuperBuild version")
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/bin/libcurl.dll)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libcurl${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
......@@ -11,6 +11,7 @@ if(USE_SYSTEM_EXPAT)
message(STATUS " Using expat system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using Expat SuperBuild version")
ExternalProject_Add(${proj}
PREFIX ${proj}
......@@ -27,8 +28,13 @@ else()
-DBUILD_tools:BOOL=OFF
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
message(STATUS " Using Expat SuperBuild version")
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/expat.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libexpat${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
......@@ -22,6 +22,7 @@ else()
# TODO : get precompiled binaries as not all MSVC versions can compile FFTW
message(STATUS " FFTW SuperBuild is not available yet...")
else()
message(STATUS " Using FFTW SuperBuild version")
# Compile the float version of FFTW
ExternalProject_Add(${projFloat}
PREFIX ${proj}
......@@ -69,8 +70,12 @@ else()
# DEPENDEES patch update
# DEPENDERS configure
# )
message(STATUS " Using FFTW SuperBuild version")
add_custom_target(${proj})
add_dependencies(${proj} ${projDouble} ${projFloat})
set(${proj}_INCLUDE_PATH ${SB_INSTALL_PREFIX}/include)
endif()
......
......@@ -11,87 +11,33 @@ if(USE_SYSTEM_GDAL)
message(STATUS " Using GDAL system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using GDAL SuperBuild version")
if(USE_SYSTEM_TIFF)
if(NOT SYSTEM_TIFF_PREFIX STREQUAL "")
list(APPEND GDAL_SB_CONFIG --with-libtiff=${SYSTEM_TIFF_PREFIX})
endif()
else()
list(APPEND GDAL_SB_CONFIG --with-libtiff=${SB_INSTALL_PREFIX})
list(APPEND ${proj}_DEPENDENCIES TIFF)
endif()
if(USE_SYSTEM_GEOTIFF)
# TODO : handle specific prefix
else()
list(APPEND GDAL_SB_CONFIG --with-geotiff=${SB_INSTALL_PREFIX})
list(APPEND ${proj}_DEPENDENCIES GEOTIFF)
endif()
if(USE_SYSTEM_PNG)
# TODO : handle specific prefix
else()
list(APPEND GDAL_SB_CONFIG --with-png=${SB_INSTALL_PREFIX})
list(APPEND ${proj}_DEPENDENCIES PNG)
endif()
#gdal on msvc link with internal jpeg .
if(USE_SYSTEM_JPEG)
# TODO : handle specific prefix
else()
list(APPEND GDAL_SB_CONFIG --with-jpeg=${SB_INSTALL_PREFIX})
list(APPEND ${proj}_DEPENDENCIES JPEG)
endif()
if(USE_SYSTEM_OPENJPEG)
# TODO : handle specific prefix
else()
list(APPEND GDAL_SB_CONFIG --with-openjpeg=${SB_INSTALL_PREFIX})
list(APPEND ${proj}_DEPENDENCIES OPENJPEG)
endif()
if(USE_SYSTEM_SQLITE)
# TODO : handle specific prefix
else()
list(APPEND GDAL_SB_CONFIG --with-sqlite3=${SB_INSTALL_PREFIX})
list(APPEND ${proj}_DEPENDENCIES SQLITE)
endif()
if(USE_SYSTEM_GEOS)
# TODO : handle specific prefix
else()
list(APPEND GDAL_SB_CONFIG --with-geos=${SB_INSTALL_PREFIX}/bin/geos-config)
list(APPEND ${proj}_DEPENDENCIES GEOS)
endif()
if(USE_SYSTEM_ZLIB)
# TODO : handle specific prefix
else()
# Not shure this setting works with zlib
list(APPEND GDAL_SB_CONFIG --with-libz=${SB_INSTALL_PREFIX})
list(APPEND ${proj}_DEPENDENCIES ZLIB)
endif()
if(USE_SYSTEM_EXPAT)
# TODO : handle specific prefix
else()
list(APPEND GDAL_SB_CONFIG --with-expat=${SB_INSTALL_PREFIX})
list(APPEND ${proj}_DEPENDENCIES EXPAT)
endif()
# declare dependencies
set(${proj}_DEPENDENCIES TIFF GEOTIFF PNG JPEG OPENJPEG SQLITE GEOS ZLIB EXPAT LIBKML CURL)
INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
# set proj back to its original value
set(proj GDAL)
if(USE_SYSTEM_LIBKML)
# TODO : handle specific prefix
else()
list(APPEND GDAL_SB_CONFIG --with-libkml=${SB_INSTALL_PREFIX})
list(APPEND ${proj}_DEPENDENCIES LIBKML)
endif()
ADD_SUPERBUILD_CONFIGURE_VAR(TIFF_SB_ROOT --with-libtiff)
ADD_SUPERBUILD_CONFIGURE_VAR(GEOTIFF_SB_ROOT --with-geotiff)
ADD_SUPERBUILD_CONFIGURE_VAR(PNG_SB_ROOT --with-png)
ADD_SUPERBUILD_CONFIGURE_VAR(JPEG_SB_ROOT --with-jpeg)
ADD_SUPERBUILD_CONFIGURE_VAR(OPENJPEG_SB_ROOT --with-openjpeg)
ADD_SUPERBUILD_CONFIGURE_VAR(SQLITE_SB_ROOT --with-sqlite3)
ADD_SUPERBUILD_CONFIGURE_VAR(GEOS_SB_ROOT --with-geos)
ADD_SUPERBUILD_CONFIGURE_VAR(ZLIB_SB_ROOT --with-libz)
ADD_SUPERBUILD_CONFIGURE_VAR(EXPAT_SB_ROOT --with-expat)
ADD_SUPERBUILD_CONFIGURE_VAR(LIBKML_SB_ROOT --with-libkml)
ADD_SUPERBUILD_CONFIGURE_VAR(CURL_SB_ROOT --with-curl)
if(USE_SYSTEM_CURL)
# TODO : handle specific prefix
else()
list(APPEND GDAL_SB_CONFIG --with-curl=${SB_INSTALL_PREFIX})
list(APPEND ${proj}_DEPENDENCIES CURL)
endif()
#if(USE_SYSTEM_TIFF)
# if(NOT SYSTEM_TIFF_PREFIX STREQUAL "")
# list(APPEND GDAL_SB_CONFIG --with-libtiff=${SYSTEM_TIFF_PREFIX})
# endif()
#else()
# list(APPEND GDAL_SB_CONFIG --with-libtiff=${SB_INSTALL_PREFIX})
#endif()
if(UNIX)
set(GDAL_SB_EXTRA_OPTIONS "" CACHE STRING "Extra options to be passed to GDAL configure script")
......@@ -145,10 +91,14 @@ else()
INSTALL_COMMAND nmake /f ${GDAL_SB_BUILD_DIR}/makefile.vc devinstall MSVC_VER=${MSVC_VERSION} EXT_NMAKE_OPT=${CMAKE_BINARY_DIR}/nmake_gdal_extra.opt
)
endif()
message(STATUS " Using GDAL SuperBuild version")
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/bin/gdal111.dll)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgdal${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
......@@ -12,7 +12,8 @@ if(USE_SYSTEM_GEOS)
message(STATUS " Using GEOS system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using GEOS SuperBuild version")
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://download.osgeo.org/geos/geos-3.4.2.tar.bz2"
......@@ -29,7 +30,12 @@ else()
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
message(STATUS " Using GEOS SuperBuild version")
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/bin/geos.dll)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgeos${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
......@@ -11,71 +11,35 @@ if(USE_SYSTEM_GEOTIFF)
message(STATUS " Using libgeotiff system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using GeoTIFF SuperBuild version")
# handle dependencies : TIFF Proj4 Zlib Jpeg
if(USE_SYSTEM_TIFF)
if(MSVC)
list(APPEND GEOTIFF_SB_CONFIG ${SYSTEM_TIFF_CMAKE_CACHE})
else()
if(NOT SYSTEM_TIFF_PREFIX STREQUAL "")
list(APPEND GEOTIFF_SB_CONFIG --with-libtiff=${SYSTEM_TIFF_PREFIX})
endif()
endif()
else()
if(MSVC)
list(APPEND GEOTIFF_SB_CONFIG
-DTIFF_INCLUDE_DIR:STRING=${SB_INSTALL_PREFIX}/include
-DTIFF_LIBRARY:STRING=${SB_INSTALL_PREFIX}/lib/libtiff_i.lib
)
else()
list(APPEND GEOTIFF_SB_CONFIG --with-libtiff=${SB_INSTALL_PREFIX})
endif()
list(APPEND ${proj}_DEPENDENCIES TIFF)
endif()
if(USE_SYSTEM_PROJ)
set(GEOTIFF_SB_PROJ_CONFIG)
else()
set(GEOTIFF_SB_PROJ_CONFIG --with-proj=${SB_INSTALL_PREFIX})
if(MSVC)
set(GEOTIFF_SB_PROJ_CONFIG
-DPROJ4_INCLUDE_DIR:STRING=${SB_INSTALL_PREFIX}/include
-DPROJ4_LIBRARY:STRING=${SB_INSTALL_PREFIX}/lib/proj_i.lib
)
endif()
list(APPEND ${proj}_DEPENDENCIES PROJ)
endif()
# declare dependencies
set(${proj}_DEPENDENCIES TIFF PROJ JPEG ZLIB)
INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
# set proj back to its original value
set(proj GEOTIFF)
if(USE_SYSTEM_ZLIB)
set(GEOTIFF_SB_ZLIB_CONFIG)
if(MSVC)
ADD_SUPERBUILD_CMAKE_VAR(TIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(TIFF_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(PROJ4_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(PROJ4_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(JPEG_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(JPEG_LIBRARY)
else()
# geotiff configure script doesn't use the given path for zlib
# so this feature is not enabled
set(GEOTIFF_SB_ZLIB_CONFIG)
if(MSVC)
set(GEOTIFF_SB_ZLIB_CONFIG
-DZLIB_INCLUDE_DIR:STRING=${SB_INSTALL_PREFIX}/include
-DZLIB_LIBRARY:STRING=${SB_INSTALL_PREFIX}/lib/zlib.lib
)
list(APPEND ${proj}_DEPENDENCIES ZLIB)
endif()
#set(GEOTIFF_SB_ZLIB_CONFIG --with-zlib=${SB_INSTALL_PREFIX})
#list(APPEND ${proj}_DEPENDENCIES ZLIB)
ADD_SUPERBUILD_CONFIGURE_VAR(TIFF_SB_ROOT --with-libtiff)
ADD_SUPERBUILD_CONFIGURE_VAR(PROJ_SB_ROOT --with-proj)
ADD_SUPERBUILD_CONFIGURE_VAR(ZLIB_SB_ROOT --with-zlib)
ADD_SUPERBUILD_CONFIGURE_VAR(JPEG_SB_ROOT --with-jpeg)
endif()
if(USE_SYSTEM_JPEG)
set(GEOTIFF_SB_JPEG_CONFIG)
else()
set(GEOTIFF_SB_JPEG_CONFIG --with-jpeg=${SB_INSTALL_PREFIX})
if(MSVC)
set(GEOTIFF_SB_JPEG_CONFIG
-DJPEG_INCLUDE_DIR:STRING=${SB_INSTALL_PREFIX}/include
-DJPEG_LIBRARY:STRING=${SB_INSTALL_PREFIX}/lib/libjpeg.lib
)
list(APPEND ${proj}_DEPENDENCIES JPEG)
endif()
endif()
#if(MSVC)
# set(GEOTIFF_SB_ZLIB_CONFIG
# -DZLIB_INCLUDE_DIR:STRING=${SB_INSTALL_PREFIX}/include
# -DZLIB_LIBRARY:STRING=${SB_INSTALL_PREFIX}/lib/zlib.lib
# )
if(MSVC)
......@@ -98,10 +62,8 @@ else()
-DWITH_JPEG:BOOL=OFF
-DWITH_ZLIB:BOOL=ON
-DWITH_UTILITIES:BOOL=ON
-DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
${GEOTIFF_SB_CONFIG}
${GEOTIFF_SB_JPEG_CONFIG}
${GEOTIFF_SB_PROJ_CONFIG}
${GEOTIFF_SB_ZLIB_CONFIG}
CMAKE_COMMAND
)
else()
......@@ -117,11 +79,7 @@ else()
${GEOTIFF_SB_BUILD_DIR}/configure
--prefix=${SB_INSTALL_PREFIX}
--enable-static=no
${GEOTIFF_SB_JPEG_CONFIG}
${GEOTIFF_SB_CONFIG}
${GEOTIFF_SB_PROJ_CONFIG}
${GEOTIFF_SB_ZLIB_CONFIG}
BUILD_COMMAND $(MAKE)
INSTALL_COMMAND $(MAKE) install
DEPENDS ${${proj}_DEPENDENCIES}
......@@ -139,6 +97,6 @@ else()
endif()
message(STATUS " Using GeoTIFF SuperBuild version")
endif()
endif()
......@@ -11,6 +11,7 @@ if(USE_SYSTEM_ITK)
message(STATUS " Using ITK system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using ITK SuperBuild version")
# if(MSVC)
# set(ITK_SB_SRC "C:/Temp/ITK")
......@@ -105,56 +106,35 @@ else()
list(APPEND ITK_MODULES_CMAKE_CACHE -DModule_ITK${ITK_MODULE}:BOOL=ON)
endforeach()
# declare dependencies
set(${proj}_DEPENDENCIES TIFF EXPAT PNG ZLIB FFTW)
INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
# set proj back to its original value
set(proj ITK)
ADD_SUPERBUILD_CMAKE_VAR(TIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(TIFF_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(EXPAT_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(EXPAT_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(PNG_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(PNG_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_LIBRARY)
# By default activate FFTW, but with an external fftw build
# These variables are used in ITK to initialize the value of the ITK_USE_FFTW_XXX options
if (WIN32)
set(ITK_SB_FFTW_CONFIG
list(APPEND ITK_SB_CONFIG
-DUSE_FFTWF:BOOL=OFF
-DUSE_FFTWD:BOOL=OFF
)
else()
set(ITK_SB_FFTW_CONFIG
list(APPEND ITK_SB_CONFIG
-DUSE_FFTWF:BOOL=ON
-DUSE_FFTWD:BOOL=ON
-DUSE_SYSTEM_FFTW:BOOL=ON
)
if (NOT USE_SYSTEM_FFTW)
set(ITK_SB_FFTW_CONFIG ${ITK_SB_FFTW_CONFIG}
-DFFTW_INCLUDE_PATH:PATH=${SB_INSTALL_PREFIX}/include
)
list(APPEND ${proj}_DEPENDENCIES FFTWF)
list(APPEND ${proj}_DEPENDENCIES FFTWD)
endif()
endif()
# TODO : handle different build type (Release/Debug)
if(USE_SYSTEM_TIFF)
list(APPEND ITK_SB_CONFIG ${SYSTEM_ITK_CMAKE_CACHE})
else()
list(APPEND ${proj}_DEPENDENCIES TIFF)
endif()
if(USE_SYSTEM_EXPAT)
# TODO : handle specific prefix
else()
list(APPEND ${proj}_DEPENDENCIES EXPAT)
endif()
if(USE_SYSTEM_PNG)
# TODO : handle specific prefix
else()
list(APPEND ${proj}_DEPENDENCIES EXPAT)
endif()
if(USE_SYSTEM_ZLIB)
# TODO : handle specific prefix
else()
list(APPEND ${proj}_DEPENDENCIES ZLIB)
endif()
if(MSVC)
ADD_SUPERBUILD_CMAKE_VAR(FFTW_INCLUDE_PATH)
endif()
ExternalProject_Add(${proj}
......@@ -178,7 +158,6 @@ else()
-DITK_USE_SYSTEM_ZLIB:BOOL=ON
-DITK_USE_SYSTEM_TIFF:BOOL=ON
-DITK_USE_SYSTEM_PNG:BOOL=ON
${ITK_SB_FFTW_CONFIG}
${ITK_SB_CONFIG}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/patches/ITK/hashtable.hxx.in
......@@ -191,6 +170,7 @@ else()
# "configure_file(${CMAKE_SOURCE_DIR}/patches_ITK/hashtable.hxx.in
# ${ITK_SB_SRC}/Modules/ThirdParty/KWSys/src/KWSys/hashtable.hxx.in COPYONLY)")
message(STATUS " Using ITK SuperBuild version")
set(ITK_DIR ${SB_INSTALL_PREFIX}/lib/cmake/ITK-4.6)
endif()
endif()
......@@ -11,6 +11,7 @@ if(USE_SYSTEM_JPEG)
message(STATUS " Using libjpeg system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using libjpeg SuperBuild version")
if(WIN32)
......@@ -62,6 +63,12 @@ else()
endif()
message(STATUS " Using libjpeg SuperBuild version")
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libjpeg.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libjpeg${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
......@@ -11,34 +11,18 @@ if(USE_SYSTEM_LIBKML)
message(STATUS " Using libKML system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using libKML SuperBuild version")
# declare dependencies
set(${proj}_DEPENDENCIES EXPAT ZLIB BOOST)
INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
# set proj back to its original value
set(proj LIBKML)
if(USE_SYSTEM_EXPAT)
set(LIBKML_SB_EXPAT_CONFIG)
else()
set(LIBKML_SB_EXPAT_CONFIG
-DEXPAT_INCLUDE_DIR:STRING=${SB_INSTALL_PREFIX}/include
-DEXPAT_LIBRARY:STRING=${SB_INSTALL_PREFIX}/lib/libexpat${CMAKE_SHARED_LIBRARY_SUFFIX}
)
if(MSVC)
set(LIBKML_SB_EXPAT_CONFIG
-DEXPAT_INCLUDE_DIR:STRING=${SB_INSTALL_PREFIX}/include
-DEXPAT_LIBRARY:STRING=${SB_INSTALL_PREFIX}/lib/expat.lib
)
endif()
list(APPEND ${proj}_DEPENDENCIES EXPAT)
endif()
if(USE_SYSTEM_BOOST)
# TODO : handle specific prefix
else()
list(APPEND ${proj}_DEPENDENCIES BOOST)
endif()
if(USE_SYSTEM_ZLIB)
# TODO : handle specific prefix
else()
list(APPEND ${proj}_DEPENDENCIES ZLIB)
endif()
ADD_SUPERBUILD_CMAKE_VAR(EXPAT_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(EXPAT_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(Boost_INCLUDE_DIR)
ExternalProject_Add(${proj}
PREFIX ${proj}
......@@ -53,10 +37,28 @@ else()
-DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
${LIBKML_SB_EXPAT_CONFIG}
${LIBKML_SB_CONFIG}
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
message(STATUS " Using libKML SuperBuild version")
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_BASE_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlbase.lib)
set(${proj}_CONVENIENCE_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlconvenience.lib)
set(${proj}_DOM_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmldom.lib)
set(${proj}_ENGINE_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlengine.lib)
set(${proj}_REGIONATOR_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlregionator.lib)
set(${proj}_XSD_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlxsd.lib)
set(${proj}_MINIZIP_LIBRARY ${SB_INSTALL_PREFIX}/lib/minizip.lib)
elseif(UNIX)
set(${proj}_BASE_LIBRARY ${SB_INSTALL_PREFIX}/lib/libkmlbase${CMAKE_SHARED_LIBRARY_SUFFIX})
set(${proj}_CONVENIENCE_LIBRARY ${SB_INSTALL_PREFIX}/lib/libkmlconvenience${CMAKE_SHARED_LIBRARY_SUFFIX})
set(${proj}_DOM_LIBRARY ${SB_INSTALL_PREFIX}/lib/libkmldom${CMAKE_SHARED_LIBRARY_SUFFIX})
set(${proj}_ENGINE_LIBRARY ${SB_INSTALL_PREFIX}/lib/libkmlengine${CMAKE_SHARED_LIBRARY_SUFFIX})
set(${proj}_REGIONATOR_LIBRARY ${SB_INSTALL_PREFIX}/lib/libkmlregionator${CMAKE_SHARED_LIBRARY_SUFFIX})
set(${proj}_XSD_LIBRARY ${SB_INSTALL_PREFIX}/lib/libkmlxsd${CMAKE_SHARED_LIBRARY_SUFFIX})
set(${proj}_MINIZIP_LIBRARY ${SB_INSTALL_PREFIX}/lib/libminizip${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
......@@ -11,6 +11,7 @@ if(USE_SYSTEM_MUPARSER)
message(STATUS " Using muParser system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using muParser SuperBuild version")
ExternalProject_Add(${proj}
PREFIX ${proj}
......@@ -28,7 +29,12 @@ else()
${MUPARSER_SB_SRC}
)
message(STATUS " Using muParser SuperBuild version")
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/muparser.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libmuparser${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
......@@ -11,10 +11,11 @@ if(USE_SYSTEM_MUPARSERX)
message(STATUS " Using muParserX system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using muParserX SuperBuild version")
set(MUPARSERX_FLAGS)
if(APPLE)
set(MUPARSERX_FLAGS -std=c++0x)
set(MUPARSERX_FLAGS "-DCMAKE_CXX_FLAGS:STRING=-std=c++0x")
endif()
# svn checkout http://muparserx.googlecode.com/svn/trunk/ muparserx-read-only
......@@ -39,7 +40,12 @@ else()
${MUPARSERX_SB_SRC}
)
message(STATUS " Using muParserX SuperBuild version")
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/muparserx.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libmuparserx${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
......@@ -11,6 +11,7 @@ if(USE_SYSTEM_OPENCV)
message(STATUS " Using OpenCV system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using OpenCV SuperBuild version")
#TODO: add these properly
# list(APPEND ${proj}_DEPENDENCIES TIFF)
......@@ -71,6 +72,6 @@ else()
DEPENDS ${${proj}_DEPENDENCIES}
)
message(STATUS " Using OpenCV SuperBuild version")
set(OpenCV_DIR ${SB_INSTALL_PREFIX}/share/OpenCV)
endif()
endif()
......@@ -12,20 +12,18 @@ if(USE_SYSTEM_OPENJPEG)
message(STATUS " Using OpenJpeg system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using OpenJPEG SuperBuild version")
# handle dependencies : TIFF, ZLIB, ...
# although they seem un-used by the openjp2 codec
if(USE_SYSTEM_TIFF)
list(APPEND OPENJPEG_SB_CONFIG ${SYSTEM_TIFF_CMAKE_CACHE})
else()
list(APPEND ${proj}_DEPENDENCIES TIFF)
endif()
# declare dependencies
set(${proj}_DEPENDENCIES TIFF ZLIB)
INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
# set proj back to its original value
set(proj OPENJPEG)
if(USE_SYSTEM_ZLIB)
# TODO : handle specific prefix
else()
list(APPEND ${proj}_DEPENDENCIES ZLIB)
endif()
ADD_SUPERBUILD_CMAKE_VAR(TIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(TIFF_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_LIBRARY)
if(MSVC)
#TODO: add LCMS dependency
......@@ -55,8 +53,12 @@ else()
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
message(STATUS " Using OpenJPEG SuperBuild version")
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/openjp2.lib)
elseif(UNIX)