External_proj.cmake 1.54 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(PROJ)
22

23
SETUP_SUPERBUILD(PROJ)
24

25 26 27 28 29 30 31 32 33
ExternalProject_Add(PROJ
  PREFIX PROJ
  URL "http://download.osgeo.org/proj/proj-4.9.3.tar.gz"
  URL_MD5 d598336ca834742735137c5674b214a1
  BINARY_DIR ${PROJ_SB_SRC}
  INSTALL_DIR ${SB_INSTALL_PREFIX}
  DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
  CMAKE_CACHE_ARGS
  ${SB_CMAKE_CACHE_ARGS}
34 35 36
  -DBUILD_LIBPROJ_SHARED:BOOL=TRUE
  -DVERSIONED_OUTPUT:BOOL=FALSE
  -DBUILD_FRAMEWORKS_AND_BUNDLE:BOOL=FALSE
37 38 39
  -DPROJ_LIB_SUBDIR:STRING=lib
  -DPROJ_INCLUDE_SUBDIR:STRING=include
  CMAKE_COMMAND ${SB_CMAKE_COMMAND}
40
  LOG_DOWNLOAD 1
41 42 43 44
  LOG_CONFIGURE 1
  LOG_BUILD 1
  LOG_INSTALL 1
  )
45

46 47
SUPERBUILD_PATCH_SOURCE(PROJ)

48 49
set(_SB_PROJ_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
50
  set(_SB_PROJ_LIBRARY ${SB_INSTALL_PREFIX}/lib/proj.lib)
51 52 53
elseif(UNIX)
  set(_SB_PROJ_LIBRARY ${SB_INSTALL_PREFIX}/lib/libproj${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()