External_png.cmake 1.72 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#
# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
#     https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

21
INCLUDE_ONCE_MACRO(PNG)
Rashad Kanavath's avatar
Rashad Kanavath committed
22

23
SETUP_SUPERBUILD(PNG)
24

25 26
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(PNG ZLIB)
Rashad Kanavath's avatar
Rashad Kanavath committed
27

28 29
ADD_SUPERBUILD_CMAKE_VAR(PNG ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(PNG ZLIB_LIBRARY)
Rashad Kanavath's avatar
Rashad Kanavath committed
30

31 32
ExternalProject_Add(PNG
  PREFIX PNG
33
  URL "http://downloads.sourceforge.net/project/libpng/libpng16/older-releases/1.6.16/lpng1616.zip"
34 35 36 37 38 39
  URL_MD5 c90c9587c9a5c735327fb3f6900f6b03
  BINARY_DIR ${PNG_SB_BUILD_DIR}
  INSTALL_DIR ${SB_INSTALL_PREFIX}
  DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
  DEPENDS ${PNG_DEPENDENCIES}
  CMAKE_CACHE_ARGS
40
  ${SB_CMAKE_CACHE_ARGS}
41 42 43 44
  -DSKIP_INSTALL_EXECUTABLES:BOOL=OFF
  -DPNG_STATIC:BOOL=OFF
  -DPNG_SHARED:BOOL=ON
  -DPNG_TESTS:BOOL=OFF
45
  -DVERSIONED_OUTPUT_LIB:BOOL=OFF
46
  -DSKIP_INSTALL_FILES:BOOL=ON
47
  -DSKIP_INSTALL_EXPORT:BOOL=ON
48
  -DSKIP_INSTALL_EXECUTABLES:BOOL=OFF
49 50
  ${PNG_SB_CONFIG}
  CMAKE_COMMAND ${SB_CMAKE_COMMAND}
51
  LOG_DOWNLOAD 1
52 53 54
  LOG_CONFIGURE 1
  LOG_BUILD 1
  LOG_INSTALL 1
55
  )
56 57
set(_SB_PNG_PNG_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)

58 59
SUPERBUILD_PATCH_SOURCE(PNG)

60
SUPERBUILD_UPDATE_CMAKE_VARIABLES(PNG TRUE)