Commit f4681fca authored by Guillaume Pasero's avatar Guillaume Pasero

ENH: superbuild: don't mix superbuild locations with system locations

parent 4e519c71
......@@ -133,8 +133,8 @@ else()
endif() #end else MSVC
set(Boost_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(Boost_LIBRARY_DIR ${SB_INSTALL_PREFIX}/lib)
set(_SB_Boost_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_Boost_LIBRARY_DIR ${SB_INSTALL_PREFIX}/lib)
endif()
......
......@@ -58,11 +58,11 @@ else()
)
endif()
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/bin/libcurl.dll)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/bin/libcurl.dll)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libcurl${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libcurl${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -29,11 +29,11 @@ else()
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/expat.lib)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/expat.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libexpat${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libexpat${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -74,7 +74,7 @@ else()
add_custom_target(${proj})
add_dependencies(${proj} ${projDouble} ${projFloat})
set(${proj}_INCLUDE_PATH ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_PATH ${SB_INSTALL_PREFIX}/include)
endif()
......
......@@ -93,11 +93,11 @@ else()
endif()
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/bin/gdal111.dll)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/bin/gdal111.dll)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgdal${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgdal${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -30,11 +30,11 @@ else()
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/bin/geos.dll)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/bin/geos.dll)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgeos${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgeos${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -97,6 +97,12 @@ else()
endif()
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/geotiff_i.lib)
elseif(UNIX)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgeotiff${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
......@@ -170,7 +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)")
set(ITK_DIR ${SB_INSTALL_PREFIX}/lib/cmake/ITK-4.6)
set(_SB_ITK_DIR ${SB_INSTALL_PREFIX}/lib/cmake/ITK-4.6)
endif()
endif()
......@@ -63,11 +63,11 @@ else()
endif()
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libjpeg.lib)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libjpeg.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libjpeg${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libjpeg${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -41,23 +41,23 @@ else()
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${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)
set(_SB_${proj}_BASE_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlbase.lib)
set(_SB_${proj}_CONVENIENCE_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlconvenience.lib)
set(_SB_${proj}_DOM_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmldom.lib)
set(_SB_${proj}_ENGINE_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlengine.lib)
set(_SB_${proj}_REGIONATOR_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlregionator.lib)
set(_SB_${proj}_XSD_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlxsd.lib)
set(_SB_${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})
set(_SB_${proj}_BASE_LIBRARY ${SB_INSTALL_PREFIX}/lib/libkmlbase${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_CONVENIENCE_LIBRARY ${SB_INSTALL_PREFIX}/lib/libkmlconvenience${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_DOM_LIBRARY ${SB_INSTALL_PREFIX}/lib/libkmldom${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_ENGINE_LIBRARY ${SB_INSTALL_PREFIX}/lib/libkmlengine${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_REGIONATOR_LIBRARY ${SB_INSTALL_PREFIX}/lib/libkmlregionator${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_XSD_LIBRARY ${SB_INSTALL_PREFIX}/lib/libkmlxsd${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_MINIZIP_LIBRARY ${SB_INSTALL_PREFIX}/lib/libminizip${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -29,11 +29,11 @@ else()
${MUPARSER_SB_SRC}
)
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/muparser.lib)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/muparser.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libmuparser${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libmuparser${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -40,11 +40,11 @@ else()
${MUPARSERX_SB_SRC}
)
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/muparserx.lib)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/muparserx.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libmuparserx${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libmuparserx${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -72,6 +72,6 @@ else()
DEPENDS ${${proj}_DEPENDENCIES}
)
set(OpenCV_DIR ${SB_INSTALL_PREFIX}/share/OpenCV)
set(_SB_OpenCV_DIR ${SB_INSTALL_PREFIX}/share/OpenCV)
endif()
endif()
......@@ -53,11 +53,11 @@ else()
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/openjp2.lib)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/openjp2.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libopenjp2${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libopenjp2${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -54,11 +54,11 @@ else()
)
endif()
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/OpenThreads.lib)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/OpenThreads.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libOpenThreads${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libOpenThreads${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -81,11 +81,11 @@ else()
DEPENDERS configure
)
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/ossim.lib)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/ossim.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libossim${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libossim${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -69,11 +69,11 @@ else()
)
endif()
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libpng.lib)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libpng.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -74,11 +74,11 @@ else()
)
endif()
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/proj_i.lib)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/proj_i.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libproj${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libproj${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -54,11 +54,11 @@ else()
endif()
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/sqlite3.lib)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/sqlite3.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libsqlite3${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libsqlite3${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -80,9 +80,9 @@ else()
endif()
if(WIN32)
set(SWIG_EXECUTABLE ${SB_INSTALL_PREFIX}/bin/swig.exe)
set(_SB_SWIG_EXECUTABLE ${SB_INSTALL_PREFIX}/bin/swig.exe)
elseif(UNIX)
set(SWIG_EXECUTABLE ${SB_INSTALL_PREFIX}/bin/swig)
set(_SB_SWIG_EXECUTABLE ${SB_INSTALL_PREFIX}/bin/swig)
endif()
endif()
......
......@@ -92,11 +92,11 @@ else()
endif()
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libtiff_i.lib)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libtiff_i.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libtiff${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libtiff${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -29,11 +29,11 @@ else()
${TINYXML_SB_SRC}
)
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/tinyXML.lib)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/tinyXML.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libtinyxml${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libtinyxml${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -42,11 +42,11 @@ else()
)
endif()
set(${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/zdll.lib)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/zdll.lib)
elseif(UNIX)
set(${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libz${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libz${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
......@@ -75,7 +75,11 @@ endmacro(INCLUDE_SUPERBUILD_DEPENDENCIES)
# Macro to add a cmake variable to ${proj}_SB_CONFIG (var type: string)
macro(ADD_SUPERBUILD_CMAKE_VAR var)
if(DEFINED ${var})
if(DEFINED _SB_${var})
list(APPEND ${proj}_SB_CONFIG
-D${var}:STRING=${_SB_${var}}
)
elseif(DEFINED ${var})
list(APPEND ${proj}_SB_CONFIG
-D${var}:STRING=${${var}}
)
......@@ -84,7 +88,11 @@ endmacro(ADD_SUPERBUILD_CMAKE_VAR)
# Macro to add a configure variable to ${proj}_SB_CONFIG
macro(ADD_SUPERBUILD_CONFIGURE_VAR var name)
if(DEFINED ${var})
if(DEFINED _SB_${var})
list(APPEND ${proj}_SB_CONFIG
${name}=${_SB_${var}}
)
elseif(DEFINED ${var})
list(APPEND ${proj}_SB_CONFIG
${name}=${${var}}
)
......
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