Skip to content
Snippets Groups Projects
Commit 163eb019 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

ENH: Jira-753: support custom system location

parent 31e74b9f
No related branches found
No related tags found
No related merge requests found
......@@ -13,14 +13,14 @@ ADD_SYSTEM_PREFIX(PROJECT ${proj})
if(USE_SYSTEM_TIFF)
message(STATUS " Using libtiff system version")
else()
set(${proj}_DEPENDENCIES)
set(TIFF_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
set(TIFF_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})
SETUP_SUPERBUILD(PROJECT ${proj})
if(USE_SYSTEM_ZLIB)
set(TIFF_SB_ZLIB_CONFIG)
if(NOT SYSTEM_ZLIB_PREFIX STREQUAL "")
list(APPEND TIFF_SB_CONFIG --with-zlib-include-dir=${SYSTEM_ZLIB_PREFIX}/include)
endif()
else()
set(TIFF_SB_ZLIB_CONFIG
list(APPEND TIFF_SB_CONFIG
--with-zlib-include-dir=${CMAKE_INSTALL_PREFIX}/include
)
list(APPEND ${proj}_DEPENDENCIES ZLIB)
......@@ -32,7 +32,6 @@ else()
list(APPEND ${proj}_DEPENDENCIES JPEG)
endif()
set(TIFF_SB_ZLIB_CONFIG)
STRING(REGEX REPLACE "/$" "" CMAKE_WIN_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
STRING(REGEX REPLACE "/" "\\\\" CMAKE_WIN_INSTALL_PREFIX ${CMAKE_WIN_INSTALL_PREFIX})
configure_file(${CMAKE_SOURCE_DIR}/patches/${proj}/nmake.opt ${CMAKE_BINARY_DIR}/nmake_libtiff_extra.opt)
......@@ -79,7 +78,7 @@ else()
${TIFF_SB_BUILD_DIR}/configure
--prefix=${CMAKE_INSTALL_PREFIX}
--enable-static=no
${TIFF_SB_ZLIB_CONFIG}
${TIFF_SB_CONFIG}
BUILD_COMMAND $(MAKE)
INSTALL_COMMAND $(MAKE) install
DEPENDS ${${proj}_DEPENDENCIES}
......
......@@ -4,8 +4,9 @@ set(proj ZLIB)
set(DEFAULT_USE_SYSTEM_ZLIB ON)
option(USE_SYSTEM_ZLIB " Use a system build of Zlib." ${DEFAULT_USE_SYSTEM_ZLIB})
mark_as_advanced(USE_SYSTEM_ZLIB)
SETUP_SYSTEM_LIBRARY(PROJECT ${proj} DOC " Use a system build of Zlib.")
ADD_SYSTEM_PREFIX(PROJECT ${proj} CMAKE_ALIAS ZLIB_ROOT)
if(USE_SYSTEM_ZLIB)
message(STATUS " Using Zlib system version")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment