Commit 7665d889 authored by Guillaume Pasero's avatar Guillaume Pasero

RMV: remove unused superbuild macros, they should be ported to the projects using OTB

parent fb0caf07
message(STATUS "Setup FLTK...")
set(proj FLTK)
set(DEFAULT_USE_SYSTEM_FLTK OFF)
option(USE_SYSTEM_FLTK " Use FLTK installed on system." ${DEFAULT_USE_SYSTEM_FLTK})
mark_as_advanced(USE_SYSTEM_FLTK)
if(USE_SYSTEM_FLTK)
message(STATUS " Using FLTK system version")
else()
set(${proj}_DEPENDENCIES)
set(FLTK_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
set(FLTK_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
set(FLTK_SB_BUILD_SHARED ON)
if(MSVC)
set(FLTK_SB_BUILD_SHARED OFF)
endif()
if(NOT USE_SYSTEM_ZLIB)
list(APPEND ${proj}_DEPENDENCIES ZLIB)
endif()
if(USE_SYSTEM_JPEG)
set(FLTK_SB_JPEG_CONFIG)
else()
if(MSVC)
set(FLTK_SB_JPEG_CONFIG
-DJPEG_INCLUDE_DIR:PATH=${CMAKE_INSTALL_PREFIX}/include
-DJPEG_LIBRARY:FILEPATH=${CMAKE_INSTALL_PREFIX}/lib/libjpeg.lib)
else(UNIX)
set(FLTK_SB_JPEG_CONFIG
-DJPEG_INCLUDE_DIR:PATH=${CMAKE_INSTALL_PREFIX}/include
-DJPEG_LIBRARY:FILEPATH=${CMAKE_INSTALL_PREFIX}/lib/libjpeg.so)
endif()
list(APPEND ${proj}_DEPENDENCIES JPEG)
endif()
if(USE_SYSTEM_PNG)
list(APPEND ${proj}_DEPENDENCIES PNG)
endif()
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://fltk.org/pub/fltk/1.3.3/fltk-1.3.3-source.tar.gz"
URL_MD5 9ccdb0d19dc104b87179bd9fd10822e3
BINARY_DIR ${FLTK_SB_BUILD_DIR}
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
-DOPTION_BUILD_EXAMPLES:BOOL=OFF
-DOPTION_BUILD_SHARED_LIBS:BOOL=${FLTK_SB_BUILD_SHARED}
-DOPTION_USE_SYSTEM_LIBPNG:BOOL=ON
-DOPTION_USE_SYSTEM_LIBJPEG:BOOL=ON
-DOPTION_USE_SYSTEM_ZLIB:BOOL=ON
-DLIB_zlib:BOOL=ON
-DLIB_jpeg:BOOL=ON
-DLIB_png:BOOL=ON
${FLTK_SB_JPEG_CONFIG}
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
message(STATUS " Using FLTK SuperBuild version")
endif()
message(STATUS "Setup glew...")
set(proj GLEW)
set(DEFAULT_USE_SYSTEM_GLEW ON)
option(USE_SYSTEM_GLEW " Use system installed GLEW." ${DEFAULT_USE_SYSTEM_GLEW})
mark_as_advanced(USE_SYSTEM_GLEW)
if(USE_SYSTEM_GLEW)
message(STATUS " Using glew system version")
else()
set(GLEW_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
set(GLEW_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
if(MSVC)
set(SB_GLEW_DIR "Release/Win32")
# TODO: add proper check for x64
# if ${CMAKE_SYSTEM_PROCESSOR} MATCHES "")
# set(SB_GLEW_DIR "Release/x64")
# endif()
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "https://sourceforge.net/projects/glew/files/glew/1.12.0/glew-1.12.0-win32.zip/download"
URL_MD5 13bde2ce4168c1288f8d75ef6e051b56
BINARY_DIR ${GLEW_SB_BUILD_DIR}
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory ${GLEW_SB_SRC}/include ${CMAKE_INSTALL_PREFIX}/include
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy ${GLEW_SB_SRC}/lib/${SB_GLEW_DIR}/glew32s.lib ${CMAKE_INSTALL_PREFIX}/lib
BUILD_COMMAND ${CMAKE_COMMAND} -E copy ${GLEW_SB_SRC}/lib/${SB_GLEW_DIR}/glew32.lib ${CMAKE_INSTALL_PREFIX}/lib
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${GLEW_SB_SRC}/bin/${SB_GLEW_DIR}/glew32.dll ${CMAKE_INSTALL_PREFIX}/bin/
)
message(STATUS " Using glew SuperBuild version (prebuilt binaries) ")
else(UNIX)
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "https://sourceforge.net/projects/glew/files/glew/1.12.0/glew-1.12.0.tgz/download"
URL_MD5 01246c7ecd135d99be031aa63f86dca1
BINARY_DIR ${GLEW_SB_BUILD_DIR}
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
)
message(STATUS " Using glew SuperBuild version")
endif()
endif()
message(STATUS "Setup glfw...")
set(proj GLFW)
set(DEFAULT_USE_SYSTEM_GLFW ON)
option(USE_SYSTEM_GLFW " Use system installed GLFW." ${DEFAULT_USE_SYSTEM_GLFW})
mark_as_advanced(USE_SYSTEM_GLFW)
if(USE_SYSTEM_GLFW)
message(STATUS " Using glfw system version")
else()
set(${proj}_DEPENDENCIES)
set(GLFW_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
set(GLFW_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://sourceforge.net/projects/glfw/files/glfw/3.1/glfw-3.1.zip/download"
URL_MD5 c4f6901c88ad0795f7c5da6b5599202f
BINARY_DIR ${GLFW_SB_BUILD_DIR}
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=ON
-DGLFW_BUILD_EXAMPLES:BOOL=OFF
-DGLFW_BUILD_DOCS:BOOL=OFF
-DGLFW_BUILD_TESTS:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
)
message(STATUS " Using glfw SuperBuild version")
endif()
message(STATUS "Setup glut...")
set(proj GLUT)
set(DEFAULT_USE_SYSTEM_GLUT ON)
option(USE_SYSTEM_GLUT " Use system installed GLUT." ${DEFAULT_USE_SYSTEM_GLUT})
mark_as_advanced(USE_SYSTEM_GLUT)
if(USE_SYSTEM_GLUT)
message(STATUS " Using glut system version")
else()
set(${proj}_DEPENDENCIES)
set(GLUT_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
set(GLUT_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://heanet.dl.sourceforge.net/project/freeglut/freeglut/2.8.1/freeglut-2.8.1.tar.gz"
URL_MD5 918ffbddcffbac83c218bc52355b6d5a
BINARY_DIR ${GLUT_SB_BUILD_DIR}
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt ${GLUT_SB_SRC}
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
)
message(STATUS " Using glut SuperBuild version")
endif()
include(External_glew)
if(BUILD_ICE_APPLICATION)
include(External_glfw)
include(External_glut)
endif()
message(STATUS "Setup Ice...")
set(proj ICE)
set(ICE_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
set(ICE_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
set(${proj}_DEPENDENCIES OTB)
#need this var anyway for cmake_cache_args
set(ICE_SB_GLFW_CONFIG)
if(BUILD_ICE_APPLICATION)
if(USE_SYSTEM_GLFW)
set(ICE_SB_GLFW_CONFIG)
else()
set(ICE_SB_GLFW_CONFIG
-DGLFW_INCLUDE_DIR:PATH={CMAKE_INSTALL_PREFIX}/include
-DGLFW_LIBRARY:FILEPATH=${CMAKE_INSTALL_PREFIX}/lib/glfw.so)
list(APPEND ${proj}_DEPENDENCIES GLFW)
endif()
endif()
if(USE_SYSTEM_GLEW)
set(ICE_SB_GLEW_CONFIG)
else()
set(ICE_SB_GLEW_CONFIG
-DGLEW_INCLUDE_DIR:PATH={CMAKE_INSTALL_PREFIX}/include
-DGLEW_LIBRARY:FILEPATH=${CMAKE_INSTALL_PREFIX}/lib/glew.so)
list(APPEND ${proj}_DEPENDENCIES GLEW)
endif()
if(USE_SYSTEM_ITK)
set(ICE_SB_ITK_CONFIG)
else()
set(ICE_SB_ITK_CONFIG
-DITK_DIR:PATH=${CMAKE_INSTALL_PREFIX}/lib/cmake/ITK-4.6)
list(APPEND ${proj}_DEPENDENCIES ITK)
endif()
if(USE_SYSTEM_TINYXML)
set(ICE_SB_TINYXML_CONFIG)
else()
set(ICE_SB_TINYXML_CONFIG
-DTINYXML_INCLUDE_DIR:PATH=${CMAKE_INSTALL_PREFIX}/include
-DTINYXML_LIBRARY:PATH=${CMAKE_INSTALL_PREFIX}/lib/libtinyXML${CMAKE_SHARED_LIBRARY_SUFFIX}
)
list(APPEND ${proj}_DEPENDENCIES TINYXML)
endif()
if(MSVC)
set(ICE_SB_ITK_CONFIG)
set(ICE_SB_GLEW_CONFIG)
set(ICE_SB_GLFW_CONFIG)
endif()
ExternalProject_Add(${proj}
DEPENDS ${${proj}_DEPENDENCIES}
PREFIX ${proj}
HG_REPOSITORY "http://hg.orfeo-toolbox.org/Ice"
HG_TAG tip
BINARY_DIR ${ICE_SB_BUILD_DIR}
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=${SB_BUILD_SHARED_LIBS}
-DBUILD_TESTING:BOOL=${BUILD_TESTING}
-DBUILD_ICE_APPLICATION:BOOL=${BUILD_ICE_APPLICATION}
-DOTB_DIR:PATH=${CMAKE_INSTALL_PREFIX}/lib/otb
${ICE_SB_ITK_CONFIG}
${ICE_SB_GLFW_CONFIG}
${ICE_SB_GLEW_CONFIG}
${ICE_SB_TINYXML_CONFIG}
)
message(STATUS " Using Ice SuperBuild version")
include(External_FLTK)
set(proj MONTEVERDI)
message(STATUS "Setup Monteverdi...")
set(MVD_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
set(MVD_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
set(${proj}_DEPENDENCIES OTB)
if(USE_SYSTEM_FLTK)
message(STATUS " Using FLTK system version")
else()
set(MVD_SB_FLTK_CONFIG)
list(APPEND ${proj}_DEPENDENCIES FLTK)
endif()
ExternalProject_Add(${proj}
PREFIX ${proj}
HG_REPOSITORY "http://hg.orfeo-toolbox.org/Monteverdi"
HG_TAG tip
BINARY_DIR ${MVD_SB_BUILD_DIR}
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=${SB_BUILD_SHARED_LIBS}
-DBUILD_TESTING:BOOL=ON
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
${MVD_SB_FLTK_CONFIG}
)
message(STATUS " Using Monteverdi SuperBuild version")
include(External_qwt)
set(proj MONTEVERDI2)
message(STATUS "Setup Monteverdi2...")
set(MVD2_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
set(MVD2_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
set(${proj}_DEPENDENCIES ICE)
if(USE_SYSTEM_QT4)
message(STATUS " Using Qt4 system version")
else()
set(MVD2_SB_QT4_CONFIG)
if(MSVC)
list(APPEND ${proj}_DEPENDENCIES QT4)
set(MVD2_SB_QT4_CONFIG)
else(UNIX)
message(STATUS " This platform does not provide Qt4 via SuperBuild")
endif()
endif()
if(USE_SYSTEM_QWT)
message(STATUS " Using Qwt system version")
else()
set(MVD2_SB_QWT_CONFIG)
if(MSVC)
list(APPEND ${proj}_DEPENDENCIES QWT)
set(MVD2_SB_QWT_CONFIG)
else(UNIX)
message(STATUS " This platform does not provide Qwt via SuperBuild")
endif()
endif()
#TODO: control build testing via cmake variable properly
ExternalProject_Add(${proj}
PREFIX ${proj}
HG_REPOSITORY "http://hg.orfeo-toolbox.org/Monteverdi2"
HG_TAG tip
BINARY_DIR ${MVD2_SB_BUILD_DIR}
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=${SB_BUILD_SHARED_LIBS}
-DBUILD_TESTING:BOOL=ON
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
-DCMAKE_PREFIX_PATH:STRING=${CMAKE_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
-DOTB_DATA_ROOT:STRING=${OTB_DATA_ROOT}
${MVD2_SB_QT4_CONFIG}
${MVD2_SB_QWT_CONFIG}
)
message(STATUS " Using Monteverdi2 SuperBuild version")
set(proj QWT)
message(STATUS "Setup Qwt...")
set(DEFAULT_USE_SYSTEM_QWT OFF)
option(USE_SYSTEM_QWT " Use system installed GLFW." ${DEFAULT_USE_SYSTEM_QWT})
mark_as_advanced(USE_SYSTEM_QWT)
set(${proj}_DEPENDENCIES)
if(USE_SYSTEM_QWT)
message(STATUS " Using ${proj} system version")
else()
if(USE_SYSTEM_QT4)
message(STATUS " Using Qt4 system version")
else()
set(MVD2_SB_QT4_CONFIG)
if(MSVC)
list(APPEND ${proj}_DEPENDENCIES QT4)
set(MVD2_SB_QT4_CONFIG)
else(UNIX)
message(STATUS " This platform does not provide Qt4 via SuperBuild")
endif()
endif()
set(QWT_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
set(QWT_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
set(QWT_SB_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM})
if(MSVC)
set(QWT_SB_MAKE_PROGRAM "nmake")
endif()
configure_file(${CMAKE_SOURCE_DIR}/patches/${proj}/qwtconfig.pri
${CMAKE_BINARY_DIR}/qwtconfig.pri
@ONLY)
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://sourceforge.net/projects/qwt/files/qwt/5.2.3/qwt-5.2.3.zip/download"
URL_MD5 310a1c8ab831f4b2219505dcb7691cf1
BINARY_DIR ${QWT_SB_SRC}
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/qwtconfig.pri ${QWT_SB_SRC}
CONFIGURE_COMMAND qmake ${QWT_SB_SRC}/qwt.pro
BUILD_COMMAND ${QWT_SB_MAKE_PROGRAM}
INSTALL_COMMAND ${QWT_SB_MAKE_PROGRAM} install
)
message(STATUS " Using Qwt SuperBuild version")
endif()
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