mirror of
https://github.com/reactos/CMake.git
synced 2024-11-28 14:01:21 +00:00
86578eccf2
Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
110 lines
2.9 KiB
CMake
110 lines
2.9 KiB
CMake
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
|
|
|
#.rst:
|
|
# FindGDAL
|
|
# --------
|
|
#
|
|
#
|
|
#
|
|
# Locate gdal
|
|
#
|
|
# This module accepts the following environment variables:
|
|
#
|
|
# ::
|
|
#
|
|
# GDAL_DIR or GDAL_ROOT - Specify the location of GDAL
|
|
#
|
|
#
|
|
#
|
|
# This module defines the following CMake variables:
|
|
#
|
|
# ::
|
|
#
|
|
# GDAL_FOUND - True if libgdal is found
|
|
# GDAL_LIBRARY - A variable pointing to the GDAL library
|
|
# GDAL_INCLUDE_DIR - Where to find the headers
|
|
|
|
#
|
|
# $GDALDIR is an environment variable that would
|
|
# correspond to the ./configure --prefix=$GDAL_DIR
|
|
# used in building gdal.
|
|
#
|
|
# Created by Eric Wing. I'm not a gdal user, but OpenSceneGraph uses it
|
|
# for osgTerrain so I whipped this module together for completeness.
|
|
# I actually don't know the conventions or where files are typically
|
|
# placed in distros.
|
|
# Any real gdal users are encouraged to correct this (but please don't
|
|
# break the OS X framework stuff when doing so which is what usually seems
|
|
# to happen).
|
|
|
|
# This makes the presumption that you are include gdal.h like
|
|
#
|
|
#include "gdal.h"
|
|
|
|
find_path(GDAL_INCLUDE_DIR gdal.h
|
|
HINTS
|
|
ENV GDAL_DIR
|
|
ENV GDAL_ROOT
|
|
PATH_SUFFIXES
|
|
include/gdal
|
|
include/GDAL
|
|
include
|
|
PATHS
|
|
~/Library/Frameworks/gdal.framework/Headers
|
|
/Library/Frameworks/gdal.framework/Headers
|
|
/sw # Fink
|
|
/opt/local # DarwinPorts
|
|
/opt/csw # Blastwave
|
|
/opt
|
|
)
|
|
|
|
if(UNIX)
|
|
# Use gdal-config to obtain the library version (this should hopefully
|
|
# allow us to -lgdal1.x.y where x.y are correct version)
|
|
# For some reason, libgdal development packages do not contain
|
|
# libgdal.so...
|
|
find_program(GDAL_CONFIG gdal-config
|
|
HINTS
|
|
ENV GDAL_DIR
|
|
ENV GDAL_ROOT
|
|
PATH_SUFFIXES bin
|
|
PATHS
|
|
/sw # Fink
|
|
/opt/local # DarwinPorts
|
|
/opt/csw # Blastwave
|
|
/opt
|
|
)
|
|
|
|
if(GDAL_CONFIG)
|
|
exec_program(${GDAL_CONFIG} ARGS --libs OUTPUT_VARIABLE GDAL_CONFIG_LIBS)
|
|
if(GDAL_CONFIG_LIBS)
|
|
string(REGEX MATCHALL "-l[^ ]+" _gdal_dashl ${GDAL_CONFIG_LIBS})
|
|
string(REPLACE "-l" "" _gdal_lib "${_gdal_dashl}")
|
|
string(REGEX MATCHALL "-L[^ ]+" _gdal_dashL ${GDAL_CONFIG_LIBS})
|
|
string(REPLACE "-L" "" _gdal_libpath "${_gdal_dashL}")
|
|
endif()
|
|
endif()
|
|
endif()
|
|
|
|
find_library(GDAL_LIBRARY
|
|
NAMES ${_gdal_lib} gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
|
|
HINTS
|
|
ENV GDAL_DIR
|
|
ENV GDAL_ROOT
|
|
${_gdal_libpath}
|
|
PATH_SUFFIXES lib
|
|
PATHS
|
|
/sw
|
|
/opt/local
|
|
/opt/csw
|
|
/opt
|
|
/usr/freeware
|
|
)
|
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GDAL DEFAULT_MSG GDAL_LIBRARY GDAL_INCLUDE_DIR)
|
|
|
|
set(GDAL_LIBRARIES ${GDAL_LIBRARY})
|
|
set(GDAL_INCLUDE_DIRS ${GDAL_INCLUDE_DIR})
|