External_glut.cmake 1.88 KB
Newer Older
1
#
Julien Michel's avatar
Julien Michel committed
2
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#
# 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(GLUT)
Rashad Kanavath's avatar
Rashad Kanavath committed
22

23 24
if(APPLE)
  message(FATAL_ERROR "Cannot activate GLUT on OSX. See manits issue #1194")
25
  return()
26
endif()
27

28
SETUP_SUPERBUILD(GLUT)
Rashad Kanavath's avatar
Rashad Kanavath committed
29

30
if(UNIX)
31 32 33 34 35 36 37 38

  set(GLUT_PATCH_COMMAND)

  set(GLUT_CONFIGURE_COMMAND  "${SB_ENV_CONFIGURE_CMD};${GLUT_SB_SRC}/configure" ${SB_CONFIGURE_ARGS})

else(MSVC)

  set(GLUT_PATCH_COMMAND ${CMAKE_COMMAND}
39 40 41
  -E copy
  ${CMAKE_SOURCE_DIR}/patches/GLUT/CMakeLists.txt
  ${GLUT_SB_SRC}
42
  )
43
  
44
  set(GLUT_CONFIGURE_COMMAND ${SB_CMAKE_COMMAND} ${SB_CMAKE_ARGS} ${SB_CMAKE_CACHE_ARGS} ${GLUT_SB_SRC} )
45 46
endif()

47 48 49 50 51 52 53
ExternalProject_Add(GLUT
  PREFIX GLUT
  URL "http://downloads.sourceforge.net/project/freeglut/freeglut/2.8.1/freeglut-2.8.1.tar.gz"
  URL_MD5 918ffbddcffbac83c218bc52355b6d5a
  BINARY_DIR ${GLUT_SB_BUILD_DIR}
  INSTALL_DIR ${SB_INSTALL_PREFIX}
  DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
54 55
  PATCH_COMMAND ${GLUT_PATCH_COMMAND}
  CONFIGURE_COMMAND ${GLUT_CONFIGURE_COMMAND}
56
  LOG_DOWNLOAD 1
57 58 59
  LOG_CONFIGURE 1
  LOG_BUILD 1
  LOG_INSTALL 1
Rashad Kanavath's avatar
Rashad Kanavath committed
60 61
  )

62 63 64 65 66
set(_SB_GLUT_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
  set(_SB_GLUT_LIBRARY ${SB_INSTALL_PREFIX}/lib/libfreeglut.lib)
elseif(UNIX)
  set(_SB_GLUT_LIBRARY ${SB_INSTALL_PREFIX}/lib/libfreeglut${CMAKE_SHARED_LIBRARY_SUFFIX})
Rashad Kanavath's avatar
Rashad Kanavath committed
67
endif()