Commit 840f3896 authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

BUG: fix jira OTB-1007

parent 91f99230
......@@ -16,7 +16,7 @@ else()
endif()
if(USE_SYSTEM_GEOS) #why geos here?. discuss with GP.
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_ROOT)
ADD_SUPERBUILD_CMAKE_VAR(CURL ZLIB_ROOT)
endif()
#TODO: add openssl and other dependencies
......
......@@ -11,16 +11,16 @@ else()
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(GDAL TIFF CURL GEOTIFF PNG JPEG OPENJPEG SQLITE GEOS ZLIB EXPAT)
ADD_SUPERBUILD_CONFIGURE_VAR(TIFF_ROOT --with-libtiff)
ADD_SUPERBUILD_CONFIGURE_VAR(GEOTIFF_ROOT --with-geotiff)
ADD_SUPERBUILD_CONFIGURE_VAR(PNG_ROOT --with-png)
ADD_SUPERBUILD_CONFIGURE_VAR(JPEG_ROOT --with-jpeg)
ADD_SUPERBUILD_CONFIGURE_VAR(OPENJPEG_ROOT --with-openjpeg)
ADD_SUPERBUILD_CONFIGURE_VAR(SQLITE_ROOT --with-sqlite3)
ADD_SUPERBUILD_CONFIGURE_VAR(ZLIB_ROOT --with-libz)
ADD_SUPERBUILD_CONFIGURE_VAR(EXPAT_ROOT --with-expat)
ADD_SUPERBUILD_CONFIGURE_VAR(CURL_ROOT --with-curl "/bin/curl-config")
ADD_SUPERBUILD_CONFIGURE_VAR(GEOS_ROOT --with-geos "/bin/geos-config")
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL TIFF_ROOT --with-libtiff)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL GEOTIFF_ROOT --with-geotiff)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL PNG_ROOT --with-png)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL JPEG_ROOT --with-jpeg)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL OPENJPEG_ROOT --with-openjpeg)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL SQLITE_ROOT --with-sqlite3)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL ZLIB_ROOT --with-libz)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL EXPAT_ROOT --with-expat)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL CURL_ROOT --with-curl "/bin/curl-config")
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL GEOS_ROOT --with-geos "/bin/geos-config")
if(UNIX)
set(GDAL_SB_EXTRA_OPTIONS "" CACHE STRING "Extra options to be passed to GDAL configure script")
......
......@@ -12,14 +12,14 @@ else()
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(GEOTIFF TIFF PROJ JPEG ZLIB)
set(GEOTIFF_SB_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)
ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF TIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF TIFF_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF PROJ4_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF PROJ4_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF ZLIB_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF JPEG_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF JPEG_LIBRARY)
ExternalProject_Add(GEOTIFF
PREFIX GEOTIFF
......
......@@ -104,14 +104,14 @@ else()
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(ITK TIFF EXPAT PNG ZLIB FFTW)
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)
ADD_SUPERBUILD_CMAKE_VAR(ITK TIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(ITK TIFF_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(ITK EXPAT_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(ITK EXPAT_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(ITK PNG_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(ITK PNG_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(ITK ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(ITK 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
......@@ -126,7 +126,7 @@ else()
-DUSE_FFTWD:BOOL=ON
-DUSE_SYSTEM_FFTW:BOOL=ON
)
ADD_SUPERBUILD_CMAKE_VAR(FFTW_INCLUDE_PATH)
ADD_SUPERBUILD_CMAKE_VAR(ITK FFTW_INCLUDE_PATH)
endif()
# forward compilation flags
......
......@@ -12,11 +12,11 @@ else()
##set(LIBKML_DEPENDENCIES EXPAT ZLIB BOOST)
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(LIBKML EXPAT ZLIB BOOST)
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)
ADD_SUPERBUILD_CMAKE_VAR(LIBKML EXPAT_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(LIBKML EXPAT_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(LIBKML ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(LIBKML ZLIB_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(LIBKML Boost_INCLUDE_DIR)
ExternalProject_Add(LIBKML
PREFIX LIBKML
......
......@@ -8,10 +8,10 @@ message(STATUS " Using Monteverdi SuperBuild version")
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(MVD OTB QWT QT4)
set(MVD_SB_CONFIG)
ADD_SUPERBUILD_CMAKE_VAR(OTB_DIR)
ADD_SUPERBUILD_CMAKE_VAR(QWT_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(QWT_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(QT_QMAKE_EXECUTABLE)
ADD_SUPERBUILD_CMAKE_VAR(MVD OTB_DIR)
ADD_SUPERBUILD_CMAKE_VAR(MVD QWT_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(MVD QWT_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(MVD QT_QMAKE_EXECUTABLE)
#TODO: control build testing via cmake variable properly
ExternalProject_Add(MVD
......
......@@ -11,12 +11,12 @@ else()
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(OPENCV ZLIB TIFF PNG)
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(TIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(TIFF_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(PNG_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(PNG_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OPENCV ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OPENCV ZLIB_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OPENCV TIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OPENCV TIFF_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OPENCV PNG_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OPENCV PNG_LIBRARY)
ExternalProject_Add(OPENCV
PREFIX OPENCV
......
......@@ -12,12 +12,12 @@ else()
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(OPENJPEG ZLIB TIFF PNG)
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)
ADD_SUPERBUILD_CMAKE_VAR(PNG_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(PNG_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OPENJPEG TIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OPENJPEG TIFF_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OPENJPEG ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OPENJPEG ZLIB_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OPENJPEG PNG_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OPENJPEG PNG_LIBRARY)
if(MSVC)
#TODO: add LCMS dependency
......
......@@ -17,18 +17,18 @@ else()
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(OSSIM TIFF GEOTIFF GEOS JPEG OPENTHREADS FREETYPE)
ADD_SUPERBUILD_CMAKE_VAR(TIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(TIFF_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(GEOS_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(GEOS_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(JPEG_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(JPEG_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OPENTHREADS_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OPENTHREADS_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(FREETYPE_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(FREETYPE_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM TIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM TIFF_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM GEOTIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM GEOTIFF_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM GEOS_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM GEOS_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM JPEG_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM JPEG_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM OPENTHREADS_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM OPENTHREADS_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM FREETYPE_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM FREETYPE_LIBRARY)
set(OSSIM_CXX_FLAGS -D__STDC_CONSTANT_MACROS)
......
......@@ -71,65 +71,62 @@ if(OTB_USE_GLUT)
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(OTB GLUT)
endif()
ADD_SUPERBUILD_CMAKE_VAR(GDAL_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(GDAL_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB GDAL_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB GDAL_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OSSIM_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB OSSIM_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB OSSIM_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(GDAL_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(GDAL_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB ITK_DIR)
ADD_SUPERBUILD_CMAKE_VAR(ITK_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB MUPARSER_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB MUPARSER_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(MUPARSER_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(MUPARSER_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB MUPARSERX_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB MUPARSERX_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(MUPARSERX_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(MUPARSERX_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB TINYXML_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB TINYXML_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(TINYXML_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(TINYXML_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB Boost_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB Boost_LIBRARY_DIR)
ADD_SUPERBUILD_CMAKE_VAR(Boost_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(Boost_LIBRARY_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_BASE_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_CONVENIENCE_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_DOM_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_ENGINE_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_REGIONATOR_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_XSD_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_MINIZIP_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(LIBKML_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(LIBKML_BASE_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(LIBKML_CONVENIENCE_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(LIBKML_DOM_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(LIBKML_ENGINE_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(LIBKML_REGIONATOR_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(LIBKML_XSD_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(LIBKML_MINIZIP_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB OpenCV_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OpenCV_DIR)
ADD_SUPERBUILD_CMAKE_VAR(LIBSVM_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(LIBSVM_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB LIBSVM_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB LIBSVM_LIBRARY)
if(OTB_USE_CURL)
ADD_SUPERBUILD_CMAKE_VAR(CURL_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(CURL_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB CURL_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB CURL_LIBRARY)
endif()
if(MSVC)
ADD_SUPERBUILD_CMAKE_VAR(JPEG_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB JPEG_LIBRARY)
endif()
ADD_SUPERBUILD_CMAKE_VAR(SWIG_EXECUTABLE)
ADD_SUPERBUILD_CMAKE_VAR(OTB SWIG_EXECUTABLE)
if(OTB_USE_GLEW)
ADD_SUPERBUILD_CMAKE_VAR(GLEW_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(GLEW_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB GLEW_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB GLEW_LIBRARY)
endif()
if(OTB_USE_GLFW)
ADD_SUPERBUILD_CMAKE_VAR(GLFW_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(GLFW_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB GLFW_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB GLFW_LIBRARY)
endif()
if(OTB_USE_GLUT)
ADD_SUPERBUILD_CMAKE_VAR(GLUT_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(GLUT_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OTB GLUT_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OTB GLUT_LIBRARY)
endif()
if(SUPERBUILD_IN_OTB_TREE)
......
......@@ -11,8 +11,8 @@ else()
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(PNG ZLIB)
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(PNG ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(PNG ZLIB_LIBRARY)
ExternalProject_Add(PNG
PREFIX PNG
......
......@@ -11,11 +11,10 @@ else()
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(TIFF ZLIB JPEG)
set(TIFF_SB_CONFIG)
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)
ADD_SUPERBUILD_CMAKE_VAR(TIFF ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(TIFF ZLIB_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(TIFF JPEG_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(TIFF JPEG_LIBRARY)
if(MSVC)
......
......@@ -78,28 +78,55 @@ macro(ADDTO_DEPENDENCIES_IF_NOT_SYSTEM project)
endmacro(ADDTO_DEPENDENCIES_IF_NOT_SYSTEM)
# Macro to add a cmake variable to ${proj}_SB_CONFIG (var type: string)
macro(ADD_SUPERBUILD_CMAKE_VAR var)
if(DEFINED _SB_${var})
list(APPEND ${proj}_SB_CONFIG
-D${var}:STRING=${_SB_${var}}
macro(ADD_SUPERBUILD_CMAKE_VAR project var_name)
set (extra_macro_args ${ARGN})
# Did we get any optional args?
list(LENGTH extra_macro_args num_extra_args)
if (${num_extra_args} GREATER 0)
list(GET extra_macro_args 0 optional_arg)
set(var_type ${optional_arg})
else()
#try a guess for type from variable name using
#CMake's variable naming convention!
#convert to string to list so we ZLIB_INCLUDE_DIR as ZLIB, INCLUDE, DIR
string(REPLACE "_" ";" var_name_parts ${var_name})
#reverse the list.
#We are only interested in the last part _DIR(s) or _LIBRARY, _ROOT etc..
list(REVERSE var_name_parts)
#simply pop first item to have the last part of var_name
list(GET var_name_parts 0 var_name_last_part)
#set var_type.
if( "${var_name_last_part}" STREQUAL "DIR")
set(var_type PATH)
elseif("${var_name_last_part}" STREQUAL "LIBRARY")
set(var_type FILEPATH)
else()
set(var_type STRING)
endif()
endif ()
if(DEFINED _SB_${var_name})
list(APPEND ${project}_SB_CONFIG
-D${var_name}:${var_type}=${_SB_${var_name}}
)
elseif(DEFINED ${var})
list(APPEND ${proj}_SB_CONFIG
-D${var}:STRING=${${var}}
elseif(DEFINED ${var_name})
list(APPEND ${project}_SB_CONFIG
-D${var_name}:${var_type}=${${var_name}}
)
endif()
endmacro(ADD_SUPERBUILD_CMAKE_VAR)
# Macro to add a configure variable to ${proj}_SB_CONFIG
# optional 3rd argument : suffix to the variable
macro(ADD_SUPERBUILD_CONFIGURE_VAR var name)
set(suffix "${ARGV2}")
macro(ADD_SUPERBUILD_CONFIGURE_VAR project var name)
set(suffix "${ARGV3}")
if(DEFINED _SB_${var})
list(APPEND ${proj}_SB_CONFIG
list(APPEND ${project}_SB_CONFIG
${name}=${_SB_${var}}${suffix}
)
elseif(DEFINED ${var})
list(APPEND ${proj}_SB_CONFIG
list(APPEND ${project}_SB_CONFIG
${name}=${${var}}${suffix}
)
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