Skip to content
Commits on Source (101)
Original Author:
Gerald Evenden
--------------------------------------------------------------------------------
Authors
--------------------------------------------------------------------------------
Original Author
................................................................................
Gerald Evenden (1935-2016)
Maintainer(s)
................................................................................
Kristian Evers <kreve@sdfe.dk>
Even Rouault <even.rouault@spatialys.com>
Project Steering Committee
--------------------------------------------------------------------------------
Process and membership can be found at:
https://proj.org/community/rfc/rfc-1.html
Chair
................................................................................
Kristian Evers <kreve@sdfe.dk>
Members
................................................................................
Maintainer(s):
Frank Warmerdam <warmerdam@pobox.com>
Howard Butler <howard@hobu.co>
Contributors:
Brent Fraser <bfraser@geoanalytic.com>
Chris Stuber <imap@chesapeake.net>
Craig Bruce <cbruce@cubewerx.com>
Victor Osipkov <vctos@email.com>
Andrea Antonello <andrea.antonello@hydrologis.com>
Charles Karney <charles.karney@sri.com>
Karsten Engsager
Knud Poder
Kristian Evers <kreve@sdfe.dk>
Thomas Knudsen <thokn@sdfe.dk>
Even Rouault <even.rouault@spatialys.com>
Kurt Schwehr <schwehr@gmail.com>
Contributors
--------------------------------------------------------------------------------
The full list of contributors can be found on GitHub
https://github.com/OSGeo/PROJ/graphs/contributors
To cite PROJ in publications use:
PROJ contributors (2018). PROJ coordinate transformation software
library. Open Source Geospatial Foundation. URL https://proj4.org/.
PROJ contributors (2019). PROJ coordinate transformation software
library. Open Source Geospatial Foundation. URL https://proj.org/.
A BibTeX entry for LaTeX users is
.. code-block:: latex
@Manual{,
title = {{PROJ} coordinate transformation software library},
author = {{PROJ contributors}},
organization = {Open Source Geospatial Foundation},
year = {2018},
url = {https://proj4.org/},
year = {2019},
url = {https://proj.org/},
}
#################################################################################
################################################################################
#
# This file is part of CMake configuration for PROJ library (inspired from SOCI
# CMake, Copyright (C) 2009-2010 Mateusz Loskot <mateusz@loskot.net> )
......@@ -6,51 +6,83 @@
# Copyright (C) 2011 Nicolas David <nicolas.david@ign.fr>
# Distributed under the MIT license
#
#################################################################################
################################################################################
# General settings
#################################################################################
cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
################################################################################
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
# For historic reasons, the CMake PROJECT-NAME is PROJ4
project(PROJ4 LANGUAGES C CXX)
set(PROJECT_INTERN_NAME PROJ)
if (NOT CMAKE_VERSION VERSION_LESS 3.1)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
cmake_policy(SET CMP0054 NEW)
endif ()
# Set warnings
if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
# Suppress warning 4706 about assignment within conditional expression
# Suppress warning 4996 about sprintf, etc., being unsafe
# Suppress warning 4589 about Constructor of abstract class...ignores initializer for virtual base class (see https://github.com/weidai11/cryptopp/issues/214#issuecomment-230283061)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /wd4706 /wd4996 /D_CRT_SECURE_NO_WARNINGS")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /W4 /wd4706 /wd4996 /wd4589 /D_CRT_SECURE_NO_WARNINGS")
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wswitch -Wshadow -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Wformat-security")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wswitch -Wshadow -Wunused-parameter -Wmissing-declarations -Wformat -Wformat-security")
endif()
# Set C++ version
# Make CMAKE_CXX_STANDARD available as cache option overridable by user
set(CMAKE_CXX_STANDARD 11
CACHE STRING "C++ standard version to use (default is 11)")
message(STATUS "Requiring C++${CMAKE_CXX_STANDARD}")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
message(STATUS "Requiring C++${CMAKE_CXX_STANDARD} - done")
# Set global -fvisibility=hidden
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
# Set warnings as variables, then store as cache options
set(PROJ_common_WARN_FLAGS # common only to GNU/Clang C/C++
-Wall
-Wextra
-Wswitch
-Wshadow
-Wunused-parameter
-Wmissing-declarations
-Wformat
-Wformat-security
)
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
set(PROJ_C_WARN_FLAGS ${PROJ_common_WARN_FLAGS}
-Wmissing-prototypes
)
set(PROJ_CXX_WARN_FLAGS ${PROJ_common_WARN_FLAGS})
elseif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wswitch -Wshadow -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Wformat-security -Wfloat-conversion -Wc99-extensions -Wc11-extensions")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wswitch -Wshadow -Wunused-parameter -Wmissing-declarations -Wformat -Wformat-security -Wfloat-conversion")
set(PROJ_C_WARN_FLAGS ${PROJ_common_WARN_FLAGS}
-Wmissing-prototypes
-Wfloat-conversion
-Wc99-extensions
-Wc11-extensions
)
set(PROJ_CXX_WARN_FLAGS ${PROJ_common_WARN_FLAGS}
-Wfloat-conversion
)
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
add_definitions(/D_CRT_SECURE_NO_WARNINGS) # Eliminate deprecation warnings
set(PROJ_C_WARN_FLAGS
/W4
/wd4706 # Suppress warning about assignment within conditional expression
/wd4996 # Suppress warning about sprintf, etc., being unsafe
)
set(PROJ_CXX_WARN_FLAGS /EHsc ${PROJ_C_WARN_FLAGS})
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
if(MSVC)
set(PROJ_C_WARN_FLAGS /Wall)
set(PROJ_CXX_WARN_FLAGS /Wall)
else()
set(PROJ_C_WARN_FLAGS -Wall)
set(PROJ_CXX_WARN_FLAGS -Wall)
endif()
endif()
set(PROJ_C_WARN_FLAGS "${PROJ_C_WARN_FLAGS}"
CACHE STRING "C flags used to compile PROJ targets")
set(PROJ_CXX_WARN_FLAGS "${PROJ_CXX_WARN_FLAGS}"
CACHE STRING "C++ flags used to compile PROJ targets")
# Tell Intel compiler to do arithmetic accurately. This is needed to
# stop the compiler from ignoring parentheses in expressions like
# (a + b) + c and from simplifying 0.0 + x to x (which is wrong if
# x = -0.0).
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
if (MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:precise")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qstd=c++11")
else ()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif ()
endif ()
#################################################################################
################################################################################
# PROJ CMake modules
#################################################################################
################################################################################
# Path to additional CMake modules
set(CMAKE_MODULE_PATH ${PROJ4_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
......@@ -59,79 +91,105 @@ include(ProjUtilities)
message(STATUS "")
colormsg(_HIBLUE_ "Configuring PROJ:")
#################################################################################
################################################################################
#PROJ version information
#################################################################################
################################################################################
include(ProjVersion)
proj_version(MAJOR 5 MINOR 2 PATCH 0)
set(PROJ_API_VERSION "14")
set(PROJ_BUILD_VERSION "14.0.2")
proj_version(MAJOR 6 MINOR 1 PATCH 1)
set(PROJ_API_VERSION "16")
set(PROJ_BUILD_VERSION "16.1.1")
#################################################################################
################################################################################
# Build features and variants
#################################################################################
################################################################################
include(ProjSystemInfo)
include(ProjConfig)
include(ProjMac)
include(policies)
#################################################################################
################################################################################
# Check for sqlite3
################################################################################
find_program(EXE_SQLITE3 sqlite3)
if(NOT EXE_SQLITE3)
message(SEND_ERROR "sqlite3 binary not found!")
endif()
find_package(Sqlite3 REQUIRED)
if(NOT SQLITE3_FOUND)
message(SEND_ERROR "sqlite3 dependency not found!")
endif()
################################################################################
# threading configuration
#################################################################################
################################################################################
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package (Threads)
find_package(Threads)
include(CheckIncludeFiles)
include(CheckSymbolExists)
CHECK_SYMBOL_EXISTS(PTHREAD_MUTEX_RECURSIVE pthread.h HAVE_PTHREAD_MUTEX_RECURSIVE_DEFN)
if (HAVE_PTHREAD_MUTEX_RECURSIVE_DEFN)
add_definitions(-DHAVE_PTHREAD_MUTEX_RECURSIVE=1)
endif()
include (CheckCSourceCompiles)
if (MSVC)
set (CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS} /WX")
else ()
set (CMAKE_REQUIRED_LIBRARIES m)
set (CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS} -Werror")
endif ()
include(CheckCSourceCompiles)
if(MSVC)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS} /WX /W4")
else()
set(CMAKE_REQUIRED_LIBRARIES m)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall")
endif()
# Check whether the C99 math function: hypot, atanh, etc. are available.
check_c_source_compiles (
"#include <math.h>
check_c_source_compiles("
#include <math.h>
int main() {
int q;
return (int)(hypot(3.0, 4.0) + atanh(0.8) + cbrt(8.0) +
remquo(100.0, 90.0, &q) +
remainder(100.0, 90.0) + copysign(1.0, -0.0) +
log1p(0.1) + asinh(0.1)) +
isnan(0.0);
}\n" C99_MATH)
if (C99_MATH)
add_definitions (-DHAVE_C99_MATH=1)
else ()
add_definitions (-DHAVE_C99_MATH=0)
endif ()
return (int)(
hypot(3.0, 4.0) + atanh(0.8) + cbrt(8.0) +
remquo(100.0, 90.0, &q) +
remainder(100.0, 90.0) + copysign(1.0, -0.0) +
log1p(0.1) + asinh(0.1)) + isnan(0.0);
}
" C99_MATH)
if(C99_MATH)
add_definitions(-DHAVE_C99_MATH=1)
else()
add_definitions(-DHAVE_C99_MATH=0)
endif()
if(Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
set(CMAKE_REQUIRED_LIBRARIES
"${CMAKE_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}")
check_c_source_compiles("
#include <pthread.h>
int main(int argc, char* argv[]) {
(void)PTHREAD_MUTEX_RECURSIVE;
(void)argv;
return argc;
}
" HAVE_PTHREAD_MUTEX_RECURSIVE_DEFN)
if(HAVE_PTHREAD_MUTEX_RECURSIVE_DEFN)
add_definitions(-DHAVE_PTHREAD_MUTEX_RECURSIVE=1)
endif()
endif()
boost_report_value(PROJ_PLATFORM_NAME)
boost_report_value(PROJ_COMPILER_NAME)
# Set a default build type for single-configuration cmake generators if
# no build type is set.
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release)
endif ()
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
if (MSVC OR CMAKE_CONFIGURATION_TYPES)
if(MSVC OR CMAKE_CONFIGURATION_TYPES)
# For multi-config systems and for Visual Studio, the debug version of
# the library has _d appended.
set (CMAKE_DEBUG_POSTFIX _d)
endif ()
set(CMAKE_DEBUG_POSTFIX _d)
endif()
option(PROJ_TESTS "Enable build of collection of PROJ tests" ON)
boost_report_value(PROJ_TESTS)
if(PROJ_TESTS)
enable_testing()
endif(PROJ_TESTS)
enable_testing()
endif()
include(ProjTest)
# Put the libraries and binaries that get built into directories at the
......@@ -143,26 +201,34 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
#################################################################################
################################################################################
# Installation
#################################################################################
################################################################################
include(ProjInstallPath)
set(BINDIR "${DEFAULT_BINDIR}" CACHE PATH "The directory to install binaries into.")
set(LIBDIR "${DEFAULT_LIBDIR}" CACHE PATH "The directory to install libraries into.")
set(DATADIR "${DEFAULT_DATADIR}" CACHE PATH "The directory to install data files into.")
set(DOCDIR "${DEFAULT_DOCDIR}" CACHE PATH "The directory to install doc files into.")
set(INCLUDEDIR "${DEFAULT_INCLUDEDIR}" CACHE PATH "The directory to install includes into.")
set(CMAKECONFIGDIR "${DEFAULT_CMAKEDIR}" CACHE PATH "The directory to install cmake config files into.")
#################################################################################
set(BINDIR "${DEFAULT_BINDIR}"
CACHE PATH "The directory to install binaries into.")
set(LIBDIR "${DEFAULT_LIBDIR}"
CACHE PATH "The directory to install libraries into.")
set(DATADIR "${DEFAULT_DATADIR}"
CACHE PATH "The directory to install data files into.")
set(DOCDIR "${DEFAULT_DOCDIR}"
CACHE PATH "The directory to install doc files into.")
set(INCLUDEDIR "${DEFAULT_INCLUDEDIR}"
CACHE PATH "The directory to install includes into.")
set(CMAKECONFIGDIR "${DEFAULT_CMAKEDIR}"
CACHE PATH "The directory to install cmake config files into.")
################################################################################
# Build configured components
#################################################################################
################################################################################
include_directories(${PROJ4_SOURCE_DIR}/src)
message(STATUS "")
add_subdirectory(nad)
add_subdirectory(data)
add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(man)
add_subdirectory(cmake)
add_subdirectory(test)
if(PROJ_TESTS)
add_subdirectory(test)
endif()
SUBDIRS = src man nad jniwrap cmake test
SUBDIRS = include src man data jniwrap cmake
DIST_SUBDIRS = include src man data jniwrap cmake test
EXTRA_DIST = makefile.vc nmake.opt CMakeLists.txt CITATION
EXTRA_DIST = CMakeLists.txt CITATION README.md
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = proj.pc
......@@ -8,6 +9,9 @@ pkgconfig_DATA = proj.pc
AUTOMAKE_OPTIONS = dist-zip
ACLOCAL_AMFLAGS = -I m4
check-local:
cd test; $(MAKE) check
README: README.md
fgrep -v "[![" $< > $@
......
......@@ -96,7 +96,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cflags_warn_all.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
......@@ -191,7 +192,6 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/proj.pc.in AUTHORS \
COPYING ChangeLog INSTALL NEWS README compile config.guess \
config.sub depcomp install-sh ltmain.sh missing
......@@ -268,7 +268,10 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FLTO_FLAG = @FLTO_FLAG@
GREP = @GREP@
GTEST_CFLAGS = @GTEST_CFLAGS@
GTEST_LIBS = @GTEST_LIBS@
HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
......@@ -304,10 +307,14 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SQLITE3_CFLAGS = @SQLITE3_CFLAGS@
SQLITE3_CHECK = @SQLITE3_CHECK@
SQLITE3_LIBS = @SQLITE3_LIBS@
STRIP = @STRIP@
THREAD_LIB = @THREAD_LIB@
VERSION = @VERSION@
......@@ -364,8 +371,9 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = src man nad jniwrap cmake test
EXTRA_DIST = makefile.vc nmake.opt CMakeLists.txt CITATION
SUBDIRS = include src man data jniwrap cmake
DIST_SUBDIRS = include src man data jniwrap cmake test
EXTRA_DIST = CMakeLists.txt CITATION README.md
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = proj.pc
AUTOMAKE_OPTIONS = dist-zip
......@@ -736,6 +744,7 @@ distcleancheck: distclean
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-local
check: check-recursive
all-am: Makefile $(DATA)
installdirs: installdirs-recursive
......@@ -843,13 +852,13 @@ ps-am:
uninstall-am: uninstall-pkgconfigDATA
.MAKE: $(am__recursive_targets) install-am install-strip
.MAKE: $(am__recursive_targets) check-am install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool clean-local cscope cscopelist-am ctags ctags-am \
dist dist-all dist-bzip2 dist-gzip dist-lzip dist-shar \
dist-tarZ dist-xz dist-zip distcheck distclean \
am--refresh check check-am check-local clean clean-cscope \
clean-generic clean-libtool clean-local cscope cscopelist-am \
ctags ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip \
dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
distclean-generic distclean-libtool distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
......@@ -865,6 +874,9 @@ uninstall-am: uninstall-pkgconfigDATA
.PRECIOUS: Makefile
check-local:
cd test; $(MAKE) check
README: README.md
fgrep -v "[![" $< > $@
......
5.2.0 Release Notes
6.1.1 Release Notes
-------------------
Updates
-------
o Update EPSG registry to version 9.6.3 (1485)
Bug Fixes
---------
o Take the passed authority into account when identifying
objects (#1466)
o Avoid exception when transforming from NAD83 to projected
CRS using NAD83(2011) (#1477)
o Avoid off-by-one reading of name argument if name of resource
file has length 1 (#1489)
o Do not include PROJ_LIB in proj_info().searchpath when context
search path is set (#1498)
o Use correct delimeter for the current platform when parsing
PROJ_LIB (#1497)
o Do not confuse 'ID74' CRS with WKT2 ID[] node (#1506)
o WKT1 importer: do case insensitive comparison for axis
direction (#1509)
o Avoid compile errors on GCC 4.9.3 (#1512)
o Make sure that pipelines including +proj=ob_tran can be
created (#1526)
THANKS TO
------------
Version 6.1.1 is made possible by the following contributors:
Alan D. Snow
Paul Menzel
Mateusz Łoskot
Bas Couwenberg
Peter Limkilde Svendsen
Mike Taves
Howard Butler
Nyall Dawson
Andrew Bell
Kristian Evers
Even Rouault
6.1.0 Release Notes
-------------------
Updates
-------
o Include custom ellipsoid definitions from QGIS (#1337)
o Add "-k ellipsoid" option to projinfo (#1338)
o Make cs2cs support 4D coordinates (#1355)
o WKT2 parser: update to OGC 18-010r6 (#1360 #1366)
o Update internal version of googletest to v1.8.1 (#1361)
o Database update: EPSG v9.6.2 (#1462), IGNF v3.0.3, ESRI 10.7.0
and add operation_version column (#1368)
o Add proj_normalize_for_visualization() that attempts to apply axis
ordering as used by most GIS applications and PROJ <6 (#1387)
o Added noop operation (#1391)
o Paths set by user take priority over PROJ_LIB for search paths (#1398)
o Reduced database size (#1438)
o add support for compoundCRS and concatenatedOperation named from
their components (#1441)
Bug fixes
---------
o Have gie return non-zero code when file can't be opened (#1312)
o CMake cross-compilation fix (#1316)
o Use 1st eccentricity instead of 2nd eccentricity in Molodensky (#1324)
o Make sure to include grids when doing Geocentric to CompoundCRS with
nadgrids+geoidgrids transformations (#1326)
o Handle coordinates outside of bbox better (#1333)
o Enable system error messages in command line automatically in builds (#1336)
o Make sure to install projinfo man page with CMake (#1347)
o Add data dir to pkg-config file proj.pc (#1348)
o Fix GCC 9 warning about useless std::move() (#1352)
o Grid related fixes (#1369)
o Make sure that ISO19111 C++ code sets pj_errno on errors (#1405)
o vgridshift: handle longitude wrap-around for grids with 360deg
longitude extent (#1429)
o proj/cs2cs: validate value of -f parameter to avoid potential crashes (#1434)
o Many division by zero and similar bug fixes found by OSS Fuzz.
THANKS TO
------------
Version 6.1.0 is made possible by the following contributors:
Andrew Hardin
Sean Warren
Dan Baston
Howard Butler
Joris Van den Bossche
Elliott Sales de Andrade
Alan D. Snow
Nyall Dawson
Chris Mayo
Mike Taves
Kristian Evers
Even Rouault
6.0.0 Release Notes
-------------------
PROJ 6 has undergone extensive changes to increase its functional scope from a
cartographic projection engine with so-called "early-binding" geodetic datum
transformation capabilities to a more complete library supporting coordinate
transformations and coordinate reference systems.
As a foundation for other enhancements, PROJ now includes a C++ implementation
of the modelisation propopsed by the ISO-19111:2019 standard / OGC Abstract
Specification Topic 2: "Referencing By Coordinates", for geodetic reference
frames (datums), coordinate reference systems and coordinate operations.
Construction and query of those geodetic objects is available through a new C++
API, and also accessible for the most part from bindings in the C API.
Those geodetic objects can be imported and exported from and into the OGC
Well-Known Text format (WKT) in its different variants: ESRI WKT, GDAL WKT 1,
WKT2:2015 (ISO 19162:2015) and WKT2:2018 (ISO 19162:2018). Import and export of
CRS objects from and into PROJ strings is also supported. This functionality
was previously available in the GDAL software library (except WKT2 support
which is a new feature), and is now an integral part of PROJ.
A unified database of geodetic objects, coordinate reference systems and their
metadata, and coordinate operations between those CRS is now available in a
SQLite3 database file, proj.db. This includes definitions imported from the
IOGP EPSG dataset (v9.6.0 release), the IGNF (French national mapping agency)
geodetic registry and the ESRI projection engine database. PROJ is now the
reference software in the "OSGeo C stack" for this CRS and coordinate operation
database, whereas previously this functionality was spread over PROJ, GDAL and
libgeotiff, and used CSV or other adhoc text-based formats.
Late-binding coordinate operation capabilities, that takes metadata such as
area of use and accuracy into account, has been added. This can avoid in a
number of situations the past requirement of using WGS84 as a pivot system,
which could cause unneeded accuracy loss, or was not doable at all sometimes
when transformation to WGS84 was not available. Those late-binding capabilities
are now used by the proj_create_crs_to_crs() function and the cs2cs utility.
A new command line utility, projinfo, has been added to query information about
a geodetic object of the database, import and export geodetic objects from/into
WKT and PROJ strings, and display coordinate operations available between two
CRSs.
UPDATES
-------
o Removed projects.h as a public interface (#835)
o Deprecated the proj_api.h interface. The header file is still available
but will be removed with the next major version release of PROJ. It is
now required to define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H before the
interface can be used (#836)
o Removed support for the nmake build system (#838)
o Removed support for the proj_def.dat defaults file (#201)
o C++11 required for building PROJ (#1203)
o Added build dependency on SQLite 3.7 (#1175)
o Added projinfo command line application (#1189)
o Added many functions to proj.h for handling ISO19111 functionality (#1175)
o Added C++ API exposing ISO19111 functionality (#1175)
o Updated cs2cs to use late-binding features (#1182)
o Removed the nad2bin application. Now available in the proj-datumgrid
git repository (#1236)
o Removed support for Chebyshev polynomials in proj (#1226)
o Removed proj_geocentric_latitude from proj.h API (#1170)
o Changed behaviour of proj: Now only allow initialization of
projections (#1162)
o Changed behaviour of tmerc: Now default to the Extended Transverse
Mercator algorithm (etmerc). Old implementation available by adding
+approx (#404)
o Chaged behaviour: Default ellipsoid now set to GRS80 (was WGS84) (#1210)
o Allow multiple directories in PROJ_LIB environment variable (#1281)
o Added Lambert Conic Conformal (2SP Michigan) projection (#1142)
o Added Bertin1953 projection (#1133)
o Added Tobler-Mercator projection (#1153)
o Added Molodensky-Badekas transform (#1160)
o Added push and pop coordinate operations (#1250)
o Removed +t_obs parameter from helmert and deformation (#1264)
o Added +dt parameter to deformation as replacement for
removed +t_obs (#1264)
BUG FIXES
---------
o Read +towgs84 values correctly on locales not using dot as comma separator (#1136)
o Fixed file offset for reading of shift values in NTv1 files (#1144)
o Avoid problems with PTHREAD_MUTEX_RECURSIVE when using CMake (#1158)
o Avoid raising errors when setting ellipsoid flattening to zero (#1191)
o Fixed lower square calculations in rHealpix projection (#1206)
o Allow Molodensky transform parameters to be zero (#1194)
o Fixed wrong parameter in ITRF2000 init file (#1240)
o Fixed use of grid paths including spaces (#1152)
o Robinson: fix wrong values for forward path for latitudes >= 87.5 (#1172),
and fix inaccurate inverse method.
THANKS TO
------------
Version 6.0.0 is made possible by the following contributors:
Aaron Puchert
Thomas Knudsen
Phil Elson
Mateusz Łoskot
Markus Neteler
Jürgen Fischer
Charles Karney
Bas Couwenberg
Karoline Skaar
Alan D. Snow
Howard Butler
Marco Bernasocchi
Ben Boeckel
Ivan Veselov
Philippe Rivière
Mike Taves
Elliott Sales de Andrade
Kai Pastor
Kristian Evers
Even Rouault
5.2.0 Release Notes
-------------------
UPDATES
......
......@@ -7,11 +7,11 @@ This includes cartographic projections as well as geodetic transformations.
For more information on the PROJ.4 project please see the web page at:
https://proj4.org/
https://proj.org/
The PROJ.4 mailing list can be found at:
http://lists.maptools.org/mailman/listinfo/proj
https://lists.osgeo.org/mailman/listinfo/proj/
See the NEWS file for changes between versions.
......@@ -22,9 +22,14 @@ The following command line utilities are included in the PROJ package:
- geod, for geodesic (great circle) computations.
- cct, for generic Coordinate Conversions and Transformations.
- gie, the Geospatial Integrity Investigation Environment.
- projinfo, for geodetic object and coordinate operation queries
## Installation
### Build dependencies
PROJ requires C and C++11 compilers.
It also requires SQLite3 (headers, library and executable).
### Building with CMake
cd proj
......@@ -37,6 +42,11 @@ On Windows, one may need to specify generator:
cmake -G "Visual Studio 15 2017" ..
If the SQLite3 dependency is installed in a custom location, specify the
paths to the include directory and the library:
cmake -DSQLITE3_INCLUDE_DIR=/opt/SQLite/include -DSQLITE3_LIBRARY=/opt/SQLite/lib/libsqlite3.so ..
Tests are run with
ctest
......@@ -86,32 +96,6 @@ If you are building from the git repository you have to first run
which will generate a configure script that can be used as described above.
### Building on Windows with NMAKE
PROJ can be built with Microsoft Visual C/C++ using the `makefile.vc`
in the `PROJ` directory. First edit the `PROJ\nmake.opt` and
modify the `INSTDIR` value at the top to point to the directory
where the PROJ tree shall be installed.
If you want to install into `C:\PROJ`, it can remain unchanged.
Then use the `makefile.vc` to build the software e.g.:
C:\> cd proj
C:\PROJ> nmake /f makefile.vc
C:\PROJ> nmake /f makefile.vc install-all
Note that you have to have the VC++ environment variables, and path
setup properly. This may involve running the `VCVARS32.BAT`
script out of the Visual C++ tree.
The `makefile.vc` builds `proj.exe`, `proj.dll` and `proj.lib`.
On Windows you have to set the `PROJ_LIB` environment variable to make
sure that PROJ can find the resource files that it needs. For the
default install directory you can set `PROJ_LIB` with:
C:\> set PROJ_LIB=C:\PROJ\share
### Distribution files and format
Sources are distributed in one or more files. The principle elements
......
# PROJ
[![Travis Status](https://travis-ci.com/OSGeo/proj.4.svg?branch=master)](https://travis-ci.com/OSGeo/proj.4)
[![AppVeyor Status](https://ci.appveyor.com/api/projects/status/584j49uguwoo5evi?svg=true)](https://ci.appveyor.com/project/OSGeo/proj-4)
[![Coveralls Status](https://coveralls.io/repos/github/OSGeo/proj.4/badge.svg?branch=master)](https://coveralls.io/github/OSGeo/proj.4?branch=master)
[![Gitter](https://badges.gitter.im/OSGeo/proj.4.svg)](https://gitter.im/OSGeo/proj.4)
[![Mailing List](https://img.shields.io/badge/PROJ-mailing%20list-4eb899.svg)](http://lists.osgeo.org/mailman/listinfo/proj)
PROJ is a generic coordinate transformation software, that transforms
coordinates from one coordinate reference system (CRS) to another.
This includes cartographic projections as well as geodetic transformations.
For more information on the PROJ.4 project please see the web page at:
https://proj.org/
The PROJ.4 mailing list can be found at:
https://lists.osgeo.org/mailman/listinfo/proj/
See the NEWS file for changes between versions.
The following command line utilities are included in the PROJ package:
- proj, for cartographic projection of geodetic coordinates
- cs2cs, for transformation from one CRS to another CRS.
- geod, for geodesic (great circle) computations.
- cct, for generic Coordinate Conversions and Transformations.
- gie, the Geospatial Integrity Investigation Environment.
- projinfo, for geodetic object and coordinate operation queries
## Installation
### Build dependencies
PROJ requires C and C++11 compilers.
It also requires SQLite3 (headers, library and executable).
### Building with CMake
cd proj
mkdir build
cd build
cmake ..
cmake --build .
On Windows, one may need to specify generator:
cmake -G "Visual Studio 15 2017" ..
If the SQLite3 dependency is installed in a custom location, specify the
paths to the include directory and the library:
cmake -DSQLITE3_INCLUDE_DIR=/opt/SQLite/include -DSQLITE3_LIBRARY=/opt/SQLite/lib/libsqlite3.so ..
Tests are run with
ctest
The test suite requires that the proj-datumgrid package is installed
in `PROJ_LIB`.
### Building on Unix/Linux
FSF's configuration procedure is used to ease installation of the
PROJ system.
The default destination path prefix for installed files is `/usr/local`.
Results from the installation script will be placed into subdirectories
`bin`, `include`, `lib`, `man/man1` and `man/man3`.
If this default path prefix is proper, then execute:
./configure
See the note below if you are building PROJ directly from the git repository.
If another path prefix is required, then execute:
./configure --prefix=/my/path
In either case, the directory of the prefix path must exist and be
writable by the installer.
After executing configure, execute:
make
make install
The install target will create, if necessary, all required sub-directories.
Tests are run with
make check
The test suite requires that the proj-datumgrid package is installed
in `PROJ_LIB`.
#### Building from the git repository
If you are building from the git repository you have to first run
./autogen.sh
which will generate a configure script that can be used as described above.
### Distribution files and format
Sources are distributed in one or more files. The principle elements
of the system are in a compress tar file named `proj-x.y.z.tar.gz` where
"x" will indicate major release number, "y" indicates minor release
number and "z" indicates the patch number of the release.
In addition to the PROJ software package, distributions of datum
conversion grid files and PROJ parameter files are also available.
The grid package is distributed under the name `proj-datumgrid-x.y.zip`,
where "x" is the major release version and "y" the minor release
version numbers. Similarly regional packages are distributed. The
regional packages contain resources that are not essential to the
functionality of PROJ but still of value to users in the region
specific to the package. All grids that were in proj-datumgrids-1.6
remain in proj-datumgrids-1.7; the regional datumgrid files contain
grids for datums not previously supported (prior to PROJ 5.0.0).
The resource packages can be downloaded from the PROJ.4 website.
More info on the contents of the various resource packages can be
found at the
[proj-datumgrid GitHub repository](https://github.com/OSGeo/proj-datumgrid).
The resource file packages should be extracted to `PROJ_LIB`
where PROJ will find them after installation. The default location of
`PROJ_LIB` on UNIX-based systems is `/usr/local/share/proj` but it may
be changed to a different directory. On Windows you have to define
`PROJ_LIB` yourself.
### Citing PROJ in publications
See [CITATION](CITATION)
......@@ -1171,3 +1171,4 @@ m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
m4_include([m4/ltversion.m4])
m4_include([m4/lt~obsolete.m4])
m4_include([m4/pkg.m4])
......@@ -2,26 +2,33 @@
# ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative
# path to the root from there. (Note that the whole install tree can
# be relocated.)
file(RELATIVE_PATH PROJECT_ROOT_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKECONFIGDIR} ${CMAKE_INSTALL_PREFIX})
file(RELATIVE_PATH PROJECT_ROOT_DIR
${CMAKE_INSTALL_PREFIX}/${CMAKECONFIGDIR} ${CMAKE_INSTALL_PREFIX})
if(CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING_STR "ON")
else()
set(CMAKE_CROSSCOMPILING_STR "OFF")
endif()
string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER)
configure_file (project-config.cmake.in project-config.cmake @ONLY)
configure_file (project-config-version.cmake.in
configure_file(project-config.cmake.in project-config.cmake @ONLY)
configure_file(project-config-version.cmake.in
project-config-version.cmake @ONLY)
install (FILES
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/project-config.cmake"
DESTINATION "${CMAKECONFIGDIR}"
RENAME "${PROJECT_NAME_LOWER}-config.cmake")
install (FILES
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/project-config-version.cmake"
DESTINATION "${CMAKECONFIGDIR}"
RENAME "${PROJECT_NAME_LOWER}-config-version.cmake")
# Make information about the cmake targets (the library and the tools)
# available.
install (EXPORT targets
install(EXPORT targets
FILE ${PROJECT_NAME_LOWER}-targets.cmake
DESTINATION "${CMAKECONFIGDIR}")
install (EXPORT targets
install(EXPORT targets
NAMESPACE ${PROJECT_NAME}::
FILE ${PROJECT_NAME_LOWER}-namespace-targets.cmake
DESTINATION "${CMAKECONFIGDIR}")
# Find Sqlite3
# ~~~~~~~~~~~~
# Copyright (c) 2007, Martin Dobias <wonder.sk at gmail.com>
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
# CMake module to search for Sqlite3 library
#
# If it's found it sets SQLITE3_FOUND to TRUE
# and following variables are set:
# SQLITE3_INCLUDE_DIR
# SQLITE3_LIBRARY
# find_path and find_library normally search standard locations
# before the specified paths. To search non-standard paths first,
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
# and then again with no specified paths to search the default
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
# searching for the same item do nothing.
# try to use framework on mac
# want clean framework path, not unix compatibility path
if(APPLE)
if(CMAKE_FIND_FRAMEWORK MATCHES "FIRST"
OR CMAKE_FRAMEWORK_PATH MATCHES "ONLY"
OR NOT CMAKE_FIND_FRAMEWORK)
set(CMAKE_FIND_FRAMEWORK_save ${CMAKE_FIND_FRAMEWORK} CACHE STRING "" FORCE)
set(CMAKE_FIND_FRAMEWORK "ONLY" CACHE STRING "" FORCE)
#find_path(SQLITE3_INCLUDE_DIR SQLite3/sqlite3.h)
find_library(SQLITE3_LIBRARY SQLite3)
if(SQLITE3_LIBRARY)
# find_path doesn't add "Headers" for a framework
set(SQLITE3_INCLUDE_DIR ${SQLITE3_LIBRARY}/Headers
CACHE PATH "Path to a file.")
endif()
set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_save} CACHE STRING "" FORCE)
endif()
endif()
find_path(SQLITE3_INCLUDE_DIR sqlite3.h
"$ENV{LIB_DIR}/include"
"$ENV{LIB_DIR}/include/sqlite"
"$ENV{INCLUDE}"
)
find_library(SQLITE3_LIBRARY NAMES sqlite3_i sqlite3 PATHS
"$ENV{LIB_DIR}/lib"
"$ENV{LIB}/lib"
)
if(SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
set(SQLITE3_FOUND TRUE)
endif()
if(SQLITE3_FOUND)
if(NOT SQLITE3_FIND_QUIETLY)
message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARY}")
endif()
else()
if(SQLITE3_FIND_REQUIRED)
message(FATAL_ERROR "Could not find Sqlite3")
endif()
endif()
......@@ -10,5 +10,6 @@ EXTRA_DIST = CMakeLists.txt \
policies.cmake \
proj_config.cmake.in \
project-config-version.cmake.in \
project-config.cmake.in
project-config.cmake.in \
FindSqlite3.cmake
......@@ -95,7 +95,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cflags_warn_all.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
......@@ -156,7 +157,10 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FLTO_FLAG = @FLTO_FLAG@
GREP = @GREP@
GTEST_CFLAGS = @GTEST_CFLAGS@
GTEST_LIBS = @GTEST_LIBS@
HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
......@@ -192,10 +196,14 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SQLITE3_CFLAGS = @SQLITE3_CFLAGS@
SQLITE3_CHECK = @SQLITE3_CHECK@
SQLITE3_LIBS = @SQLITE3_LIBS@
STRIP = @STRIP@
THREAD_LIB = @THREAD_LIB@
VERSION = @VERSION@
......@@ -264,7 +272,8 @@ EXTRA_DIST = CMakeLists.txt \
policies.cmake \
proj_config.cmake.in \
project-config-version.cmake.in \
project-config.cmake.in
project-config.cmake.in \
FindSqlite3.cmake
all: all-am
......
......@@ -7,36 +7,45 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# https://www.boost.org/LICENSE_1_0.txt)
################################################################################
include (CheckIncludeFiles)
include (CheckLibraryExists)
include (CheckFunctionExists)
include(CheckIncludeFiles)
include(CheckLibraryExists)
include(CheckFunctionExists)
# check needed include file
check_include_files (dlfcn.h HAVE_DLFCN_H)
check_include_files (inttypes.h HAVE_INTTYPES_H)
check_include_files (jni.h HAVE_JNI_H)
check_include_files (memory.h HAVE_MEMORY_H)
check_include_files (stdint.h HAVE_STDINT_H)
check_include_files (stdlib.h HAVE_STDLIB_H)
check_include_files (string.h HAVE_STRING_H)
check_include_files (sys/stat.h HAVE_SYS_STAT_H)
check_include_files (sys/types.h HAVE_SYS_TYPES_H)
check_include_files (unistd.h HAVE_UNISTD_H)
check_include_files(dlfcn.h HAVE_DLFCN_H)
check_include_files(inttypes.h HAVE_INTTYPES_H)
check_include_files(jni.h HAVE_JNI_H)
check_include_files(memory.h HAVE_MEMORY_H)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(stdlib.h HAVE_STDLIB_H)
check_include_files(string.h HAVE_STRING_H)
check_include_files(sys/stat.h HAVE_SYS_STAT_H)
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
CHECK_FUNCTION_EXISTS(localeconv HAVE_LOCALECONV)
check_function_exists(localeconv HAVE_LOCALECONV)
check_function_exists(strerror HAVE_STRERROR)
# check libm need on unix
check_library_exists(m ceil "" HAVE_LIBM)
# check libm need on unix
check_library_exists(m ceil "" HAVE_LIBM)
set(PACKAGE "proj")
set(PACKAGE_BUGREPORT "https://github.com/OSGeo/proj.4/issues")
set(PACKAGE_BUGREPORT "https://github.com/OSGeo/PROJ/issues")
set(PACKAGE_NAME "PROJ")
set(PACKAGE_STRING "PROJ ${${PROJECT_INTERN_NAME}_VERSION}")
set(PACKAGE_TARNAME "proj")
set(PACKAGE_URL "https://proj4.org")
set(PACKAGE_URL "https://proj.org")
set(PACKAGE_VERSION "${${PROJECT_INTERN_NAME}_VERSION}")
configure_file(cmake/proj_config.cmake.in src/proj_config.h)
# check if a second proj_config.h exists (created by ./configure)
# as this is within CMake's C_INCLUDES / CXX_INCLUDES
set(AUTOCONF_PROJ_CONFIG_H "${CMAKE_SOURCE_DIR}/src/proj_config.h")
if(EXISTS ${AUTOCONF_PROJ_CONFIG_H})
message(WARNING
"Autoconf's ${AUTOCONF_PROJ_CONFIG_H} may interfere with this "
"CMake build. Run 'make distclean' in the source directory "
"before CMake's build.")
endif()
configure_file(cmake/proj_config.cmake.in src/proj_config.h)
......@@ -11,26 +11,19 @@ if(WIN32)
endif()
if(UNIX)
set(DEFAULT_PROJ_ROOT_DIR "/usr/local/")
endif(UNIX)
endif()
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX ${DEFAULT_PROJ_ROOT_DIR} CACHE PATH
"Proj install prefix" FORCE)
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${DEFAULT_PROJ_ROOT_DIR}
CACHE PATH "Proj install prefix" FORCE)
endif()
#TODO
# for data install testing the PROJ_LIB envVar
string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER)
if(WIN32)
set(DEFAULT_BIN_SUBDIR bin)
set(DEFAULT_LIB_SUBDIR local/lib)
set(DEFAULT_DATA_SUBDIR share)
set(DEFAULT_INCLUDE_SUBDIR local/include)
set(DEFAULT_DOC_SUBDIR share/doc/proj)
set(DEFAULT_CMAKE_SUBDIR local/lib/cmake/${PROJECT_NAME_LOWER})
elseif(UNIX)
if(UNIX)
include(GNUInstallDirs)
set(DEFAULT_BIN_SUBDIR ${CMAKE_INSTALL_BINDIR})
set(DEFAULT_LIB_SUBDIR ${CMAKE_INSTALL_LIBDIR})
......@@ -39,7 +32,7 @@ elseif(UNIX)
set(DEFAULT_DOC_SUBDIR ${CMAKE_INSTALL_DOCDIR})
set(DEFAULT_CMAKE_SUBDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
else()
# Common locatoins for Unix and Mac OS X
# Common locations for Unix and Mac OS X
set(DEFAULT_BIN_SUBDIR bin)
set(DEFAULT_LIB_SUBDIR lib)
set(DEFAULT_DATA_SUBDIR share/proj)
......@@ -65,13 +58,15 @@ set(PROJ_CMAKE_SUBDIR ${DEFAULT_CMAKE_SUBDIR} CACHE STRING
"Subdirectory where cmake proj-config file will be installed")
# Mark *DIR variables as advanced and dedicated to use by power-users only.
mark_as_advanced(PROJ_ROOT_DIR
PROJ_BIN_SUBDIR
PROJ_LIB_SUBDIR
PROJ_INCLUDE_SUBDIR
PROJ_DATA_SUBDIR
PROJ_DOC_SUBDIR
PROJ_CMAKE_SUBDIR )
mark_as_advanced(
PROJ_ROOT_DIR
PROJ_BIN_SUBDIR
PROJ_LIB_SUBDIR
PROJ_INCLUDE_SUBDIR
PROJ_DATA_SUBDIR
PROJ_DOC_SUBDIR
PROJ_CMAKE_SUBDIR
)
set(DEFAULT_BINDIR "${PROJ_BIN_SUBDIR}")
set(DEFAULT_LIBDIR "${PROJ_LIB_SUBDIR}")
......@@ -79,5 +74,3 @@ set(DEFAULT_DATADIR "${PROJ_DATA_SUBDIR}")
set(DEFAULT_DOCDIR "${PROJ_DOC_SUBDIR}")
set(DEFAULT_INCLUDEDIR "${PROJ_INCLUDE_SUBDIR}")
set(DEFAULT_CMAKEDIR "${PROJ_CMAKE_SUBDIR}")
if(APPLE)
set(FRAMEWORKDIR "Library/Frameworks" CACHE PATH "the path to install framework")
set(BUNDLEDIR "Applications/OSGEO" CACHE PATH "the path to install bundle")
file(RELATIVE_PATH BUNDLE_FRAME_REL_PATH_AAA "/${FRAMEWORKDIR}" "/aaa")
set(FRAMEWORKDIR "Library/Frameworks" CACHE PATH
"the path to install framework")
set(BUNDLEDIR "Applications/OSGEO" CACHE PATH
"the path to install bundle")
file(RELATIVE_PATH BUNDLE_FRAME_REL_PATH_AAA "/${FRAMEWORKDIR}" "/aaa")
string(LENGTH ${BUNDLE_FRAME_REL_PATH_AAA} AAA_LENGTH)
math(EXPR RELATIVE_PATH_LENGTH "${AAA_LENGTH}-4")
string(SUBSTRING ${BUNDLE_FRAME_REL_PATH_AAA} 0 ${RELATIVE_PATH_LENGTH} BUNDLE_FRAME_REL_PATH)
set(PROJ_INSTALL_NAME_DIR "@executable_path/${BUNDLE_FRAME_REL_PATH}/${FRAMEWORKDIR}" )
else(APPLE)
string(SUBSTRING ${BUNDLE_FRAME_REL_PATH_AAA}
0 ${RELATIVE_PATH_LENGTH} BUNDLE_FRAME_REL_PATH)
set(PROJ_INSTALL_NAME_DIR
"@executable_path/${BUNDLE_FRAME_REL_PATH}/${FRAMEWORKDIR}")
else()
set(FRAMEWORKDIR "")
set(BUNDLEDIR "")
set(PROJ_INSTALL_NAME_DIR "")
endif(APPLE)
endif()
set(PROJ_RESOURCES "" )
set(PROJ_RESOURCES "")
if(APPLE)
option(BUILD_FRAMEWORKS_AND_BUNDLE "if set to ON, build a library framework and application bundle, otherwise install classical UNIX bin/lib" OFF )
set(DEFAULT_BINDIR ${BUNDLEDIR})
boost_report_value(BUNDLEDIR)
boost_report_value(PROJ_INSTALL_NAME_DIR)
boost_report_value(FRAMEWORKDIR)
endif(APPLE)
option(BUILD_FRAMEWORKS_AND_BUNDLE
"if set to ON, build a library framework and application bundle, \
otherwise install classical UNIX bin/lib" OFF)
set(DEFAULT_BINDIR ${BUNDLEDIR})
boost_report_value(BUNDLEDIR)
boost_report_value(PROJ_INSTALL_NAME_DIR)
boost_report_value(FRAMEWORKDIR)
endif()
......@@ -56,34 +56,45 @@ if(WIN32)
if(MSVC_VERSION GREATER 1900 AND MSVC_VERSION LESS 1920) # CMake 3.8+
set(PROJ_COMPILER_NAME "msvc-14.1") #Visual Studio 2017
endif()
endif(MSVC)
endif()
if(MINGW)
set(PROJ_COMPILER_NAME "mingw-${GCC_VERSION}")
endif( MINGW )
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Intel")
set(PROJ_COMPILER_NAME "intel-win")
endif()
if(CMAKE_GENERATOR MATCHES "Win64")
set(PROJ_PLATFORM_NAME "x64")
else()
set(PROJ_PLATFORM_NAME "win32")
endif()
endif(WIN32)
endif() # WIN32
if(UNIX)
set(PROJ_COMPILER_NAME "gcc-${GCC_VERSION}")
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
set(PROJ_COMPILER_NAME "gcc-${GCC_VERSION}")
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
set(PROJ_COMPILER_NAME "intel-linux")
endif()
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
set(PROJ_PLATFORM_NAME "x64")
else()
set(PROJ_PLATFORM_NAME "x86")
endif()
endif(UNIX)
endif()
if(NOT PROJ_COMPILER_NAME)
colormsg(_RED_ "WARNING:")
colormsg(RED "Could not determine compiler toolset name to set PROJ_COMPILER_NAME variable.")
colormsg(RED "Could not determine compiler toolset name to set \
PROJ_COMPILER_NAME variable.")
endif()
if(NOT PROJ_COMPILER_NAME)
colormsg(_RED_ "WARNING:")
colormsg(RED "Could not determine platform name to set PROJ_COMPILER_NAME variable.")
colormsg(RED "Could not determine platform name to set \
PROJ_COMPILER_NAME variable.")
endif()
......@@ -8,27 +8,27 @@ function(proj_add_test_script_sh SH_NAME BIN_USE)
set(TEST_OK 1)
if(ARGV2)
set(TEST_OK 0)
set(GRID_FULLNAME ${PROJECT_SOURCE_DIR}/nad/${ARGV2})
if(EXISTS ${GRID_FULLNAME})
set(TEST_OK 1)
endif(EXISTS ${GRID_FULLNAME})
endif(ARGV2)
if( CMAKE_VERSION VERSION_LESS 2.8.4 )
set(TEST_OK 0)
message(STATUS "test with bash script need a cmake version >= 2.8.4")
set(TEST_OK 0)
set(GRID_FULLNAME ${PROJECT_SOURCE_DIR}/data/${ARGV2})
if(EXISTS ${GRID_FULLNAME})
set(TEST_OK 1)
endif()
endif()
if(CMAKE_VERSION VERSION_LESS 2.8.4)
set(TEST_OK 0)
message(STATUS "test with bash script need a cmake version >= 2.8.4")
endif()
if(${TEST_OK})
add_test( NAME "${testname}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/nad
COMMAND ${PROJECT_SOURCE_DIR}/nad/${SH_NAME}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${${BIN_USE}}
)
endif(${TEST_OK})
endif(UNIX)
add_test(NAME "${testname}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/data
COMMAND ${PROJECT_SOURCE_DIR}/test/cli/${SH_NAME}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${${BIN_USE}}
)
endif()
endif()
endfunction()
......@@ -36,10 +36,10 @@ function(proj_add_gie_test TESTNAME TESTCASE)
set(GIE_BIN "gie")
set(TESTFILE ${CMAKE_SOURCE_DIR}/test/${TESTCASE})
add_test( NAME ${TESTNAME}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${GIE_BIN}
${TESTFILE}
)
add_test(NAME ${TESTNAME}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${GIE_BIN}
${TESTFILE}
)
endfunction()
......@@ -5,7 +5,7 @@
################################################################################
# Copyright (C) 2007 Douglas Gregor <doug.gregor@gmail.com>
# Copyright (C) 2007 Troy Straszheim
# Copyright (C) 2010 Mateusz Loskot <mateusz@loskot.net>
# Copyright (C) 2010 Mateusz Loskot <mateusz@loskot.net>
#
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
......@@ -13,234 +13,16 @@
################################################################################
# Macros in this module:
#
# list_contains: Determine whether a string value is in a list.
#
# car: Return the first element in a list
#
# cdr: Return all but the first element in a list
#
# parse_arguments: Parse keyword arguments for use in other macros.
#
# proj_report_directory_property
#
# proj_target_output_name:
# proj_target_output_name:
#
################################################################################
# This utility macro determines whether a particular string value
# occurs within a list of strings:
#
# list_contains(result string_to_find arg1 arg2 arg3 ... argn)
#
# This macro sets the variable named by result equal to TRUE if
# string_to_find is found anywhere in the following arguments.
macro(list_contains var value)
set(${var})
foreach (value2 ${ARGN})
if (${value} STREQUAL ${value2})
set(${var} TRUE)
endif (${value} STREQUAL ${value2})
endforeach (value2)
endmacro(list_contains)
# This utility macro extracts the first argument from the list of
# arguments given, and places it into the variable named var.
#
# car(var arg1 arg2 ...)
macro(car var)
set(${var} ${ARGV1})
endmacro(car)
# This utility macro extracts all of the arguments given except the
# first, and places them into the variable named var.
#
# car(var arg1 arg2 ...)
macro(cdr var junk)
set(${var} ${ARGN})
endmacro(cdr)
# The parse_arguments macro will take the arguments of another macro and
# define several variables. The first argument to parse_arguments is a
# prefix to put on all variables it creates. The second argument is a
# list of names, and the third argument is a list of options. Both of
# these lists should be quoted. The rest of parse_arguments are
# arguments from another macro to be parsed.
#
# parse_arguments(prefix arg_names options arg1 arg2...)
#
# For each item in options, parse_arguments will create a variable with
# that name, prefixed with prefix_. So, for example, if prefix is
# MY_MACRO and options is OPTION1;OPTION2, then parse_arguments will
# create the variables MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These
# variables will be set to true if the option exists in the command line
# or false otherwise.
#
# For each item in arg_names, parse_arguments will create a variable
# with that name, prefixed with prefix_. Each variable will be filled
# with the arguments that occur after the given arg_name is encountered
# up to the next arg_name or the end of the arguments. All options are
# removed from these lists. parse_arguments also creates a
# prefix_DEFAULT_ARGS variable containing the list of all arguments up
# to the first arg_name encountered.
macro(parse_arguments prefix arg_names option_names)
set(DEFAULT_ARGS)
foreach(arg_name ${arg_names})
set(${prefix}_${arg_name})
endforeach(arg_name)
foreach(option ${option_names})
set(${prefix}_${option} FALSE)
endforeach(option)
set(current_arg_name DEFAULT_ARGS)
set(current_arg_list)
foreach(arg ${ARGN})
list_contains(is_arg_name ${arg} ${arg_names})
if (is_arg_name)
set(${prefix}_${current_arg_name} ${current_arg_list})
set(current_arg_name ${arg})
set(current_arg_list)
else (is_arg_name)
list_contains(is_option ${arg} ${option_names})
if (is_option)
set(${prefix}_${arg} TRUE)
else (is_option)
set(current_arg_list ${current_arg_list} ${arg})
endif (is_option)
endif (is_arg_name)
endforeach(arg)
set(${prefix}_${current_arg_name} ${current_arg_list})
endmacro(parse_arguments)
# Perform a reverse topological sort on the given LIST.
#
# topological_sort(my_list "MY_" "_EDGES")
#
# LIST is the name of a variable containing a list of elements to be
# sorted in reverse topological order. Each element in the list has a
# set of outgoing edges (for example, those other list elements that
# it depends on). In the resulting reverse topological ordering
# (written back into the variable named LIST), an element will come
# later in the list than any of the elements that can be reached by
# following its outgoing edges and the outgoing edges of any vertices
# they target, recursively. Thus, if the edges represent dependencies
# on build targets, for example, the reverse topological ordering is
# the order in which one would build those targets.
#
# For each element E in this list, the edges for E are contained in
# the variable named ${PREFIX}${E}${SUFFIX}, where E is the
# upper-cased version of the element in the list. If no such variable
# exists, then it is assumed that there are no edges. For example, if
# my_list contains a, b, and c, one could provide a dependency graph
# using the following variables:
#
# MY_A_EDGES b
# MY_B_EDGES
# MY_C_EDGES a b
#
# With the involcation of topological_sort shown above and these
# variables, the resulting reverse topological ordering will be b, a,
# c.
function(topological_sort LIST PREFIX SUFFIX)
# Clear the stack and output variable
set(VERTICES "${${LIST}}")
set(STACK)
set(${LIST})
# Loop over all of the vertices, starting the topological sort from
# each one.
foreach(VERTEX ${VERTICES})
string(TOUPPER ${VERTEX} UPPER_VERTEX)
# If we haven't already processed this vertex, start a depth-first
# search from where.
if (NOT FOUND_${UPPER_VERTEX})
# Push this vertex onto the stack with all of its outgoing edges
string(REPLACE ";" " " NEW_ELEMENT
"${VERTEX};${${PREFIX}${UPPER_VERTEX}${SUFFIX}}")
list(APPEND STACK ${NEW_ELEMENT})
# We've now seen this vertex
set(FOUND_${UPPER_VERTEX} TRUE)
# While the depth-first search stack is not empty
list(LENGTH STACK STACK_LENGTH)
while(STACK_LENGTH GREATER 0)
# Remove the vertex and its remaining out-edges from the top
# of the stack
list(GET STACK -1 OUT_EDGES)
list(REMOVE_AT STACK -1)
# Get the source vertex and the list of out-edges
separate_arguments(OUT_EDGES)
list(GET OUT_EDGES 0 SOURCE)
list(REMOVE_AT OUT_EDGES 0)
# While there are still out-edges remaining
list(LENGTH OUT_EDGES OUT_DEGREE)
while (OUT_DEGREE GREATER 0)
# Pull off the first outgoing edge
list(GET OUT_EDGES 0 TARGET)
list(REMOVE_AT OUT_EDGES 0)
string(TOUPPER ${TARGET} UPPER_TARGET)
if (NOT FOUND_${UPPER_TARGET})
# We have not seen the target before, so we will traverse
# its outgoing edges before coming back to our
# source. This is the key to the depth-first traversal.
# We've now seen this vertex
set(FOUND_${UPPER_TARGET} TRUE)
# Push the remaining edges for the current vertex onto the
# stack
string(REPLACE ";" " " NEW_ELEMENT
"${SOURCE};${OUT_EDGES}")
list(APPEND STACK ${NEW_ELEMENT})
# Setup the new source and outgoing edges
set(SOURCE ${TARGET})
string(TOUPPER ${SOURCE} UPPER_SOURCE)
set(OUT_EDGES
${${PREFIX}${UPPER_SOURCE}${SUFFIX}})
endif(NOT FOUND_${UPPER_TARGET})
list(LENGTH OUT_EDGES OUT_DEGREE)
endwhile (OUT_DEGREE GREATER 0)
# We have finished all of the outgoing edges for
# SOURCE; add it to the resulting list.
list(APPEND ${LIST} ${SOURCE})
# Check the length of the stack
list(LENGTH STACK STACK_LENGTH)
endwhile(STACK_LENGTH GREATER 0)
endif (NOT FOUND_${UPPER_VERTEX})
endforeach(VERTEX)
set(${LIST} ${${LIST}} PARENT_SCOPE)
endfunction(topological_sort)
# Small little hack that tweaks a component name (as used for CPack)
# to make sure to avoid certain names that cause problems. Sets the
# variable named varname to the "sanitized" name.
#
# FIXME: This is a complete hack. We probably need to fix the CPack
# generators (NSIS in particular) to get rid of the need for this.
macro(fix_cpack_component_name varname name)
if (${name} STREQUAL "foreach")
set(${varname} "boost_foreach")
else()
set(${varname} ${name})
endif()
endmacro()
#
# A big shout out to the cmake gurus @ compiz
#
function (colormsg)
string (ASCII 27 _escape)
function(colormsg)
string(ASCII 27 _escape)
set(WHITE "29")
set(GRAY "30")
set(RED "31")
......@@ -250,7 +32,7 @@ function (colormsg)
set(MAG "35")
set(CYAN "36")
foreach (color WHITE GRAY RED GREEN YELLOW BLUE MAG CYAN)
foreach(color WHITE GRAY RED GREEN YELLOW BLUE MAG CYAN)
set(HI${color} "1\;${${color}}")
set(LO${color} "2\;${${color}}")
set(_${color}_ "4\;${${color}}")
......@@ -261,14 +43,14 @@ function (colormsg)
set(str "")
set(coloron FALSE)
foreach(arg ${ARGV})
if (NOT ${${arg}} STREQUAL "")
if (CMAKE_COLOR_MAKEFILE)
if(NOT ${${arg}} STREQUAL "")
if(CMAKE_COLOR_MAKEFILE)
set(str "${str}${_escape}[${${arg}}m")
set(coloron TRUE)
endif()
else()
set(str "${str}${arg}")
if (coloron)
if(coloron)
set(str "${str}${_escape}[0m")
set(coloron FALSE)
endif()
......@@ -278,19 +60,19 @@ function (colormsg)
message(STATUS ${str})
endfunction()
# colormsg("Colors:"
# WHITE "white" GRAY "gray" GREEN "green"
# RED "red" YELLOW "yellow" BLUE "blue" MAG "mag" CYAN "cyan"
# _WHITE_ "white" _GRAY_ "gray" _GREEN_ "green"
# _RED_ "red" _YELLOW_ "yellow" _BLUE_ "blue" _MAG_ "mag" _CYAN_ "cyan"
# _HIWHITE_ "white" _HIGRAY_ "gray" _HIGREEN_ "green"
# _HIRED_ "red" _HIYELLOW_ "yellow" _HIBLUE_ "blue" _HIMAG_ "mag" _HICYAN_ "cyan"
# HIWHITE "white" HIGRAY "gray" HIGREEN "green"
# HIRED "red" HIYELLOW "yellow" HIBLUE "blue" HIMAG "mag" HICYAN "cyan"
# colormsg("Colors:"
# WHITE "white" GRAY "gray" GREEN "green"
# RED "red" YELLOW "yellow" BLUE "blue" MAG "mag" CYAN "cyan"
# _WHITE_ "white" _GRAY_ "gray" _GREEN_ "green"
# _RED_ "red" _YELLOW_ "yellow" _BLUE_ "blue" _MAG_ "mag" _CYAN_ "cyan"
# _HIWHITE_ "white" _HIGRAY_ "gray" _HIGREEN_ "green"
# _HIRED_ "red" _HIYELLOW_ "yellow" _HIBLUE_ "blue" _HIMAG_ "mag"
# _HICYAN_ "cyan" HIWHITE "white" HIGRAY "gray" HIGREEN "green"
# HIRED "red" HIYELLOW "yellow" HIBLUE "blue" HIMAG "mag" HICYAN "cyan"
# "right?")
#
# pretty-prints the value of a variable so that the
# pretty-prints the value of a variable so that the
# equals signs align
#
......@@ -300,82 +82,11 @@ function(boost_report_value NAME)
#message(STATUS "boost_report_value: NAME=${NAME} (${varlen})")
#message(STATUS "boost_report_value: \${NAME}=${${NAME}}")
math(EXPR padding_len 40-${varlen})
string(SUBSTRING " "
string(SUBSTRING " "
0 ${padding_len} varpadding)
colormsg("${NAME}${varpadding} = ${${NAME}}")
endfunction()
function(trace NAME)
if(BOOST_CMAKE_TRACE)
string(LENGTH "${NAME}" varlen)
math(EXPR padding_len 40-${varlen})
string(SUBSTRING "........................................"
0 ${padding_len} varpadding)
message("${NAME} ${varpadding} ${${NAME}}")
endif()
endfunction()
#
# pretty-prints the value of a variable so that the
# equals signs align
#
function(boost_report_pretty PRETTYNAME VARNAME)
string(LENGTH "${PRETTYNAME}" varlen)
math(EXPR padding_len 30-${varlen})
string(SUBSTRING " "
0 ${padding_len} varpadding)
message(STATUS "${PRETTYNAME}${varpadding} = ${${VARNAME}}")
endfunction()
#
# assert that ARG is actually a library target
#
macro(dependency_check ARG)
trace(ARG)
if (NOT "${ARG}" STREQUAL "")
get_target_property(deptype ${ARG} TYPE)
if(NOT deptype MATCHES ".*_LIBRARY$")
set(DEPENDENCY_OKAY FALSE)
list(APPEND DEPENDENCY_FAILURES ${ARG})
endif()
endif()
endmacro()
#
# Pretty-print of given property of current directory.
#
macro(proj_report_directory_property PROPNAME)
get_directory_property(${PROPNAME} ${PROPNAME})
boost_report_value(${PROPNAME})
endmacro()
#
# Scans the current directory and returns a list of subdirectories.
# Author: Robert Fleming
# Source: https://www.cmake.org/pipermail/cmake/2008-February/020114.html
#
# Third parameter is 1 if you want relative paths returned.
# Usage: list_subdirectories(the_list_is_returned_here /path/to/project TRUE)
#
macro(list_subdirectories retval curdir return_relative)
file(GLOB sub-dir RELATIVE ${curdir} *)
set(list_of_dirs "")
foreach(dir ${sub-dir})
if(IS_DIRECTORY ${curdir}/${dir})
if (${return_relative})
set(list_of_dirs ${list_of_dirs} ${dir})
else()
set(list_of_dirs ${list_of_dirs} ${curdir}/${dir})
endif()
endif()
endforeach()
set(${retval} ${list_of_dirs})
endmacro()
#
# Generates output name for given target depending on platform and version.
# For instance, on Windows, libraries get ABI version suffix proj_X_Y.{dll|lib}.
......@@ -387,12 +98,13 @@ function(proj_target_output_name TARGET_NAME OUTPUT_NAME)
endif()
if(NOT DEFINED ${PROJECT_INTERN_NAME}_VERSION)
message(SEND_ERROR "Error, the variable ${${PROJECT_INTERN_NAME}_VERSION} is not defined!")
message(SEND_ERROR
"Error, the variable ${${PROJECT_INTERN_NAME}_VERSION} is not defined!")
endif()
# On Windows, ABI version is specified using binary file name suffix.
# On Unix, suffix is empty and SOVERSION is used instead.
if (WIN32)
if(WIN32)
string(LENGTH "${${PROJECT_INTERN_NAME}_ABI_VERSION}" abilen)
if(abilen GREATER 0)
set(SUFFIX "_${${PROJECT_INTERN_NAME}_ABI_VERSION}")
......@@ -401,56 +113,3 @@ function(proj_target_output_name TARGET_NAME OUTPUT_NAME)
set(${OUTPUT_NAME} ${TARGET_NAME}${SUFFIX} PARENT_SCOPE)
endfunction()
#
# conversion from lla name to lla convert name ( without lla extension)
#
function(proj_lla_output_name LLA_INPUT_NAME LLA_OUTPUT_NAME )
get_filename_component(filename ${LLA_INPUT_NAME} NAME_WE)
get_filename_component(pathname ${LLA_INPUT_NAME} PATH)
set(${LLA_OUTPUT_NAME} ${pathname}/${filename} PARENT_SCOPE)
set(${LLA_OUTPUT_NAME} ${pathname}/${filename} PARENT_SCOPE)
endfunction()
function(proj_lla_target_name LLA_INPUT_NAME LLA_TARGET )
get_filename_component(filename ${LLA_INPUT_NAME} NAME_WE)
set(${LLA_TARGET} ${filename} PARENT_SCOPE)
endfunction()
#
# in place conversion of lla file to gsb
#
function(proj_convert_grid_lla2gsb GRID_DIRECTORY)
set(NAD2BIN_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(NAD2BIN_PATH ${NAD2BIN_DIR}/nad2bin${CMAKE_EXECUTABLE_SUFFIX})
file(TO_NATIVE_PATH ${NAD2BIN_PATH} NAD2BIN_EXE)
file(GLOB LLA_FILES ${${GRID_DIRECTORY}}/*.lla)
foreach(LLA ${LLA_FILES} )
proj_lla_output_name(${LLA} DEST_FILE)
file(TO_NATIVE_PATH ${DEST_FILE} DEST)
proj_lla_target_name(${LLA} LLA_TARGET)
if(NOT EXISTS ${DEST})
add_custom_target( ${LLA_TARGET} ALL
COMMAND ${NAD2BIN_EXE} ${DEST} "<" ${LLA}
DEPENDS nad2bin )
endif(NOT EXISTS ${DEST})
endforeach(LLA)
endfunction()
#
# add lla output list to an existing file list
#
function(proj_append_lla_output_file LLA_INPUT_FILE FILE_LIST)
set(LIST_OUT ${${FILE_LIST}})
foreach(LLA ${${LLA_INPUT_FILE}} )
proj_lla_output_name(${LLA} DEST_FILE)
file(TO_NATIVE_PATH ${DEST_FILE} DEST)
set(LIST_OUT ${LIST_OUT} ${DEST_FILE} )
endforeach(LLA ${LLA_INPUT_FILE})
set(${FILE_LIST} ${LIST_OUT} PARENT_SCOPE)
endfunction()
......@@ -6,7 +6,7 @@
# Distributed under the Boost Software License, Version 1.0
################################################################################
# Macros in this module:
#
#
# proj_version - defines version information for PROJ library
################################################################################
......@@ -17,8 +17,12 @@
# MAJOR.MINOR version is used to set SOVERSION
#
include(CMakeParseArguments)
macro(proj_version)
parse_arguments(THIS_VERSION "MAJOR;MINOR;PATCH;"
cmake_parse_arguments(THIS_VERSION
""
"MAJOR;MINOR;PATCH"
""
${ARGN})
......@@ -29,18 +33,21 @@ macro(proj_version)
# Set VERSION string
set(${PROJECT_INTERN_NAME}_VERSION
"${${PROJECT_INTERN_NAME}_VERSION_MAJOR}.${${PROJECT_INTERN_NAME}_VERSION_MINOR}.${${PROJECT_INTERN_NAME}_VERSION_PATCH}")
"${${PROJECT_INTERN_NAME}_VERSION_MAJOR}.\
${${PROJECT_INTERN_NAME}_VERSION_MINOR}.\
${${PROJECT_INTERN_NAME}_VERSION_PATCH}")
# Set ABI version string used to name binary output
# Set ABI version string used to name binary output
# On Windows, ABI version is specified using binary file name suffix.
if(WIN32)
set(${PROJECT_INTERN_NAME}_ABI_VERSION
"${${PROJECT_INTERN_NAME}_VERSION_MAJOR}_${${PROJECT_INTERN_NAME}_VERSION_MINOR}")
"${${PROJECT_INTERN_NAME}_VERSION_MAJOR}_\
${${PROJECT_INTERN_NAME}_VERSION_MINOR}")
endif()
message(STATUS "")
boost_report_value(${PROJECT_INTERN_NAME}_VERSION)
if(WIN32)
boost_report_value(${PROJECT_INTERN_NAME}_ABI_VERSION)
endif(WIN32)
endif()
endmacro()