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

ENH: superbuild: end refactoring

parent 98d4275b
...@@ -134,5 +134,9 @@ else() ...@@ -134,5 +134,9 @@ else()
endif() #end else MSVC endif() #end else MSVC
set(Boost_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(Boost_LIBRARY_DIR ${SB_INSTALL_PREFIX}/lib)
endif() endif()
endif() endif()
...@@ -11,6 +11,7 @@ if(USE_SYSTEM_CURL) ...@@ -11,6 +11,7 @@ if(USE_SYSTEM_CURL)
message(STATUS " Using cURL system version") message(STATUS " Using cURL system version")
else() else()
SETUP_SUPERBUILD(PROJECT ${proj}) SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using cURL SuperBuild version")
# declare dependencies # declare dependencies
set(${proj}_DEPENDENCIES ZLIB) set(${proj}_DEPENDENCIES ZLIB)
...@@ -18,7 +19,9 @@ else() ...@@ -18,7 +19,9 @@ else()
# set proj back to its original value # set proj back to its original value
set(proj CURL) 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 #TODO: add openssl and other dependencies
if(MSVC) if(MSVC)
...@@ -45,15 +48,22 @@ else() ...@@ -45,15 +48,22 @@ else()
INSTALL_DIR ${SB_INSTALL_PREFIX} INSTALL_DIR ${SB_INSTALL_PREFIX}
CMAKE_CACHE_ARGS CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX} -DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
-DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
-DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_CURL_EXE:BOOL=ON -DBUILD_CURL_EXE:BOOL=ON
-DBUILD_CURL_TESTS:BOOL=OFF -DBUILD_CURL_TESTS:BOOL=OFF
${CURL_SB_ZLIB_CONFIG} ${CURL_SB_CONFIG}
DEPENDS ${${proj}_DEPENDENCIES} DEPENDS ${${proj}_DEPENDENCIES}
) )
endif() 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()
endif() endif()
...@@ -11,6 +11,7 @@ if(USE_SYSTEM_EXPAT) ...@@ -11,6 +11,7 @@ if(USE_SYSTEM_EXPAT)
message(STATUS " Using expat system version") message(STATUS " Using expat system version")
else() else()
SETUP_SUPERBUILD(PROJECT ${proj}) SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using Expat SuperBuild version")
ExternalProject_Add(${proj} ExternalProject_Add(${proj}
PREFIX ${proj} PREFIX ${proj}
...@@ -27,8 +28,13 @@ else() ...@@ -27,8 +28,13 @@ else()
-DBUILD_tools:BOOL=OFF -DBUILD_tools:BOOL=OFF
CMAKE_COMMAND ${SB_CMAKE_COMMAND} 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()
endif() endif()
...@@ -22,6 +22,7 @@ else() ...@@ -22,6 +22,7 @@ else()
# TODO : get precompiled binaries as not all MSVC versions can compile FFTW # TODO : get precompiled binaries as not all MSVC versions can compile FFTW
message(STATUS " FFTW SuperBuild is not available yet...") message(STATUS " FFTW SuperBuild is not available yet...")
else() else()
message(STATUS " Using FFTW SuperBuild version")
# Compile the float version of FFTW # Compile the float version of FFTW
ExternalProject_Add(${projFloat} ExternalProject_Add(${projFloat}
PREFIX ${proj} PREFIX ${proj}
...@@ -69,8 +70,12 @@ else() ...@@ -69,8 +70,12 @@ else()
# DEPENDEES patch update # DEPENDEES patch update
# DEPENDERS configure # 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() endif()
......
...@@ -11,87 +11,33 @@ if(USE_SYSTEM_GDAL) ...@@ -11,87 +11,33 @@ if(USE_SYSTEM_GDAL)
message(STATUS " Using GDAL system version") message(STATUS " Using GDAL system version")
else() else()
SETUP_SUPERBUILD(PROJECT ${proj}) SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using GDAL SuperBuild version")
if(USE_SYSTEM_TIFF) # declare dependencies
if(NOT SYSTEM_TIFF_PREFIX STREQUAL "") set(${proj}_DEPENDENCIES TIFF GEOTIFF PNG JPEG OPENJPEG SQLITE GEOS ZLIB EXPAT LIBKML CURL)
list(APPEND GDAL_SB_CONFIG --with-libtiff=${SYSTEM_TIFF_PREFIX}) INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
endif() # set proj back to its original value
else() set(proj GDAL)
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()
if(USE_SYSTEM_LIBKML) ADD_SUPERBUILD_CONFIGURE_VAR(TIFF_SB_ROOT --with-libtiff)
# TODO : handle specific prefix ADD_SUPERBUILD_CONFIGURE_VAR(GEOTIFF_SB_ROOT --with-geotiff)
else() ADD_SUPERBUILD_CONFIGURE_VAR(PNG_SB_ROOT --with-png)
list(APPEND GDAL_SB_CONFIG --with-libkml=${SB_INSTALL_PREFIX}) ADD_SUPERBUILD_CONFIGURE_VAR(JPEG_SB_ROOT --with-jpeg)
list(APPEND ${proj}_DEPENDENCIES LIBKML) ADD_SUPERBUILD_CONFIGURE_VAR(OPENJPEG_SB_ROOT --with-openjpeg)
endif() 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) #if(USE_SYSTEM_TIFF)
# TODO : handle specific prefix # if(NOT SYSTEM_TIFF_PREFIX STREQUAL "")
else() # list(APPEND GDAL_SB_CONFIG --with-libtiff=${SYSTEM_TIFF_PREFIX})
list(APPEND GDAL_SB_CONFIG --with-curl=${SB_INSTALL_PREFIX}) # endif()
list(APPEND ${proj}_DEPENDENCIES CURL) #else()
endif() # list(APPEND GDAL_SB_CONFIG --with-libtiff=${SB_INSTALL_PREFIX})
#endif()
if(UNIX) if(UNIX)
set(GDAL_SB_EXTRA_OPTIONS "" CACHE STRING "Extra options to be passed to GDAL configure script") set(GDAL_SB_EXTRA_OPTIONS "" CACHE STRING "Extra options to be passed to GDAL configure script")
...@@ -145,10 +91,14 @@ else() ...@@ -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 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() 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()
endif() endif()
...@@ -12,7 +12,8 @@ if(USE_SYSTEM_GEOS) ...@@ -12,7 +12,8 @@ if(USE_SYSTEM_GEOS)
message(STATUS " Using GEOS system version") message(STATUS " Using GEOS system version")
else() else()
SETUP_SUPERBUILD(PROJECT ${proj}) SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using GEOS SuperBuild version")
ExternalProject_Add(${proj} ExternalProject_Add(${proj}
PREFIX ${proj} PREFIX ${proj}
URL "http://download.osgeo.org/geos/geos-3.4.2.tar.bz2" URL "http://download.osgeo.org/geos/geos-3.4.2.tar.bz2"
...@@ -29,7 +30,12 @@ else() ...@@ -29,7 +30,12 @@ else()
CMAKE_COMMAND ${SB_CMAKE_COMMAND} 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()
endif() endif()
...@@ -11,71 +11,35 @@ if(USE_SYSTEM_GEOTIFF) ...@@ -11,71 +11,35 @@ if(USE_SYSTEM_GEOTIFF)
message(STATUS " Using libgeotiff system version") message(STATUS " Using libgeotiff system version")
else() else()
SETUP_SUPERBUILD(PROJECT ${proj}) SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using GeoTIFF SuperBuild version")
# handle dependencies : TIFF Proj4 Zlib Jpeg # declare dependencies
if(USE_SYSTEM_TIFF) set(${proj}_DEPENDENCIES TIFF PROJ JPEG ZLIB)
if(MSVC) INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
list(APPEND GEOTIFF_SB_CONFIG ${SYSTEM_TIFF_CMAKE_CACHE}) # set proj back to its original value
else() set(proj GEOTIFF)
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()
if(USE_SYSTEM_ZLIB) if(MSVC)
set(GEOTIFF_SB_ZLIB_CONFIG) 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() else()
# geotiff configure script doesn't use the given path for zlib ADD_SUPERBUILD_CONFIGURE_VAR(TIFF_SB_ROOT --with-libtiff)
# so this feature is not enabled ADD_SUPERBUILD_CONFIGURE_VAR(PROJ_SB_ROOT --with-proj)
set(GEOTIFF_SB_ZLIB_CONFIG) ADD_SUPERBUILD_CONFIGURE_VAR(ZLIB_SB_ROOT --with-zlib)
if(MSVC) ADD_SUPERBUILD_CONFIGURE_VAR(JPEG_SB_ROOT --with-jpeg)
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)
endif() endif()
if(USE_SYSTEM_JPEG) #if(MSVC)
set(GEOTIFF_SB_JPEG_CONFIG) # set(GEOTIFF_SB_ZLIB_CONFIG
else() # -DZLIB_INCLUDE_DIR:STRING=${SB_INSTALL_PREFIX}/include
set(GEOTIFF_SB_JPEG_CONFIG --with-jpeg=${SB_INSTALL_PREFIX}) # -DZLIB_LIBRARY:STRING=${SB_INSTALL_PREFIX}/lib/zlib.lib
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) if(MSVC)
...@@ -98,10 +62,8 @@ else() ...@@ -98,10 +62,8 @@ else()
-DWITH_JPEG:BOOL=OFF -DWITH_JPEG:BOOL=OFF
-DWITH_ZLIB:BOOL=ON -DWITH_ZLIB:BOOL=ON
-DWITH_UTILITIES:BOOL=ON -DWITH_UTILITIES:BOOL=ON
-DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
${GEOTIFF_SB_CONFIG} ${GEOTIFF_SB_CONFIG}
${GEOTIFF_SB_JPEG_CONFIG}
${GEOTIFF_SB_PROJ_CONFIG}
${GEOTIFF_SB_ZLIB_CONFIG}
CMAKE_COMMAND CMAKE_COMMAND
) )
else() else()
...@@ -117,11 +79,7 @@ else() ...@@ -117,11 +79,7 @@ else()
${GEOTIFF_SB_BUILD_DIR}/configure ${GEOTIFF_SB_BUILD_DIR}/configure
--prefix=${SB_INSTALL_PREFIX} --prefix=${SB_INSTALL_PREFIX}
--enable-static=no --enable-static=no
${GEOTIFF_SB_JPEG_CONFIG}
${GEOTIFF_SB_CONFIG} ${GEOTIFF_SB_CONFIG}
${GEOTIFF_SB_PROJ_CONFIG}
${GEOTIFF_SB_ZLIB_CONFIG}
BUILD_COMMAND $(MAKE) BUILD_COMMAND $(MAKE)
INSTALL_COMMAND $(MAKE) install INSTALL_COMMAND $(MAKE) install
DEPENDS ${${proj}_DEPENDENCIES} DEPENDS ${${proj}_DEPENDENCIES}
...@@ -139,6 +97,6 @@ else() ...@@ -139,6 +97,6 @@ else()
endif() endif()
message(STATUS " Using GeoTIFF SuperBuild version")
endif() endif()
endif() endif()
...@@ -11,6 +11,7 @@ if(USE_SYSTEM_ITK) ...@@ -11,6 +11,7 @@ if(USE_SYSTEM_ITK)
message(STATUS " Using ITK system version") message(STATUS " Using ITK system version")
else() else()
SETUP_SUPERBUILD(PROJECT ${proj}) SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using ITK SuperBuild version")
# if(MSVC) # if(MSVC)
# set(ITK_SB_SRC "C:/Temp/ITK") # set(ITK_SB_SRC "C:/Temp/ITK")
...@@ -105,56 +106,35 @@ else() ...@@ -105,56 +106,35 @@ else()
list(APPEND ITK_MODULES_CMAKE_CACHE -DModule_ITK${ITK_MODULE}:BOOL=ON) list(APPEND ITK_MODULES_CMAKE_CACHE -DModule_ITK${ITK_MODULE}:BOOL=ON)
endforeach() 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 # 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 # These variables are used in ITK to initialize the value of the ITK_USE_FFTW_XXX options
if (WIN32) if (WIN32)
set(ITK_SB_FFTW_CONFIG list(APPEND ITK_SB_CONFIG
-DUSE_FFTWF:BOOL=OFF -DUSE_FFTWF:BOOL=OFF
-DUSE_FFTWD:BOOL=OFF -DUSE_FFTWD:BOOL=OFF
) )
else() else()
set(ITK_SB_FFTW_CONFIG list(APPEND ITK_SB_CONFIG
-DUSE_FFTWF:BOOL=ON -DUSE_FFTWF:BOOL=ON
-DUSE_FFTWD:BOOL=ON -DUSE_FFTWD:BOOL=ON
-DUSE_SYSTEM_FFTW:BOOL=ON -DUSE_SYSTEM_FFTW:BOOL=ON
) )
if (NOT USE_SYSTEM_FFTW) ADD_SUPERBUILD_CMAKE_VAR(FFTW_INCLUDE_PATH)
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)
endif() endif()
ExternalProject_Add(${proj} ExternalProject_Add(${proj}
...@@ -178,7 +158,6 @@ else() ...@@ -178,7 +158,6 @@ else()
-DITK_USE_SYSTEM_ZLIB:BOOL=ON -DITK_USE_SYSTEM_ZLIB:BOOL=ON
-DITK_USE_SYSTEM_TIFF:BOOL=ON -DITK_USE_SYSTEM_TIFF:BOOL=ON
-DITK_USE_SYSTEM_PNG:BOOL=ON -DITK_USE_SYSTEM_PNG:BOOL=ON
${ITK_SB_FFTW_CONFIG}
${ITK_SB_CONFIG} ${ITK_SB_CONFIG}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/patches/ITK/hashtable.hxx.in ${CMAKE_SOURCE_DIR}/patches/ITK/hashtable.hxx.in
...@@ -191,6 +170,7 @@ else() ...@@ -191,6 +170,7 @@ else()
# "configure_file(${CMAKE_SOURCE_DIR}/patches_ITK/hashtable.hxx.in # "configure_file(${CMAKE_SOURCE_DIR}/patches_ITK/hashtable.hxx.in
# ${ITK_SB_SRC}/Modules/ThirdParty/KWSys/src/KWSys/hashtable.hxx.in COPYONLY)") # ${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()
endif() endif()
...@@ -11,6 +11,7 @@ if(USE_SYSTEM_JPEG) ...@@ -11,6 +11,7 @@ if(USE_SYSTEM_JPEG)
message(STATUS " Using libjpeg system version") message(STATUS " Using libjpeg system version")
else() else()
SETUP_SUPERBUILD(PROJECT ${proj}) SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using libjpeg SuperBuild version")
if(WIN32) if(WIN32)
...@@ -62,6 +63,12 @@ else() ...@@ -62,6 +63,12 @@ else()
endif() 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()
endif() endif()