Skip to content
Commits on Source (7)
......@@ -5,6 +5,8 @@ To cite PROJ in publications use:
A BibTeX entry for LaTeX users is
.. code-block:: latex
@Manual{,
title = {{PROJ} coordinate transformation software library},
author = {{PROJ contributors}},
......
#################################################################################
################################################################################
#
# This file is part of CMake configuration for PROJ library (inspired from SOCI
# CMake, Copyright (C) 2009-2010 Mateusz Loskot <mateusz@loskot.net> )
......@@ -6,9 +6,9 @@
# Copyright (C) 2011 Nicolas David <nicolas.david@ign.fr>
# Distributed under the MIT license
#
#################################################################################
################################################################################
# General settings
#################################################################################
################################################################################
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
# For historic reasons, the CMake PROJECT-NAME is PROJ4
......@@ -19,46 +19,70 @@ if (NOT CMAKE_VERSION VERSION_LESS 3.1)
cmake_policy(SET CMP0054 NEW)
endif()
add_definitions(-DPROJ_COMPILATION=1)
# 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)")
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 warnings
if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
# Suppress warning 4706 about assignment within conditional expression
# Suppress warning 4996 about sprintf, etc., being unsafe
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 /D_CRT_SECURE_NO_WARNINGS")
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -Wall -Wextra -Wswitch -Wshadow -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Wformat-security")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wall -Wextra -Wswitch -Wshadow -Wunused-parameter -Wmissing-declarations -Wformat -Wformat-security")
# 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} -fvisibility=hidden -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} -fvisibility=hidden -Wall -Wextra -Wswitch -Wshadow -Wunused-parameter -Wmissing-declarations -Wformat -Wformat-security -Wfloat-conversion")
endif()
# 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")
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 (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:precise")
set(PROJ_C_WARN_FLAGS /Wall)
set(PROJ_CXX_WARN_FLAGS /Wall)
else()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fp-model precise")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
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")
#################################################################################
################################################################################
# PROJ CMake modules
#################################################################################
################################################################################
# Path to additional CMake modules
set(CMAKE_MODULE_PATH ${PROJ4_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
......@@ -67,39 +91,38 @@ include(ProjUtilities)
message(STATUS "")
colormsg(_HIBLUE_ "Configuring PROJ:")
#################################################################################
################################################################################
#PROJ version information
#################################################################################
################################################################################
include(ProjVersion)
proj_version(MAJOR 6 MINOR 0 PATCH 0)
set(PROJ_API_VERSION "15")
set(PROJ_BUILD_VERSION "15.0.0")
proj_version(MAJOR 6 MINOR 1 PATCH 0)
set(PROJ_API_VERSION "16")
set(PROJ_BUILD_VERSION "16.0.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 (NOT EXE_SQLITE3)
FIND_PACKAGE(Sqlite3 REQUIRED)
IF (NOT SQLITE3_FOUND)
MESSAGE (SEND_ERROR "sqlite3 dependency not found!")
ENDIF (NOT SQLITE3_FOUND)
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)
......@@ -107,22 +130,23 @@ include(CheckIncludeFiles)
include(CheckCSourceCompiles)
if(MSVC)
set (CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS} /WX")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS} /WX /W4")
else()
set(CMAKE_REQUIRED_LIBRARIES m)
set (CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS} -Werror")
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) +
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)
log1p(0.1) + asinh(0.1)) + isnan(0.0);
}
" C99_MATH)
if(C99_MATH)
add_definitions(-DHAVE_C99_MATH=1)
else()
......@@ -130,7 +154,8 @@ else ()
endif()
if(Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
set (CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_REQUIRED_LIBRARIES
"${CMAKE_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}")
check_c_source_compiles("
#include <pthread.h>
......@@ -164,7 +189,7 @@ option(PROJ_TESTS "Enable build of collection of PROJ tests" ON)
boost_report_value(PROJ_TESTS)
if(PROJ_TESTS)
enable_testing()
endif(PROJ_TESTS)
endif()
include(ProjTest)
# Put the libraries and binaries that get built into directories at the
......@@ -176,20 +201,26 @@ 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 "")
......
SUBDIRS = include src man data jniwrap cmake
DIST_SUBDIRS = include src man data jniwrap cmake test
EXTRA_DIST = CMakeLists.txt CITATION
EXTRA_DIST = CMakeLists.txt CITATION README.md
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = proj.pc
......
......@@ -373,7 +373,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = include src man data jniwrap cmake
DIST_SUBDIRS = include src man data jniwrap cmake test
EXTRA_DIST = CMakeLists.txt CITATION
EXTRA_DIST = CMakeLists.txt CITATION README.md
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = proj.pc
AUTOMAKE_OPTIONS = dist-zip
......
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.1, 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
-------------------
......
......@@ -22,7 +22,7 @@ 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
......@@ -43,7 +43,7 @@ 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::
paths to the include directory and the library:
cmake -DSQLITE3_INCLUDE_DIR=/opt/SQLite/include -DSQLITE3_LIBRARY=/opt/SQLite/lib/libsqlite3.so ..
......
# 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://proj4.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)
......@@ -2,7 +2,14 @@
# ${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)
......
......@@ -12,7 +12,7 @@
# SQLITE3_LIBRARY
# FIND_PATH and FIND_LIBRARY normally search standard locations
# 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
......@@ -21,46 +21,47 @@
# try to use framework on mac
# want clean framework path, not unix compatibility path
IF (APPLE)
IF (CMAKE_FIND_FRAMEWORK MATCHES "FIRST"
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 (SQLITE3_LIBRARY)
SET (CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_save} CACHE STRING "" FORCE)
ENDIF ()
ENDIF (APPLE)
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
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
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 (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
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 (NOT SQLITE3_FIND_QUIETLY)
if(SQLITE3_FOUND)
if(NOT SQLITE3_FIND_QUIETLY)
message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARY}")
endif()
ELSE (SQLITE3_FOUND)
else()
IF (SQLITE3_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Sqlite3")
ENDIF (SQLITE3_FIND_REQUIRED)
if(SQLITE3_FIND_REQUIRED)
message(FATAL_ERROR "Could not find Sqlite3")
endif()
ENDIF (SQLITE3_FOUND)
endif()
......@@ -24,7 +24,8 @@ 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)
......@@ -41,10 +42,10 @@ set(PACKAGE_VERSION "${${PROJECT_INTERN_NAME}_VERSION}")
# 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.")
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,13 +11,13 @@ 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
......@@ -58,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
mark_as_advanced(
PROJ_ROOT_DIR
PROJ_BIN_SUBDIR
PROJ_LIB_SUBDIR
PROJ_INCLUDE_SUBDIR
PROJ_DATA_SUBDIR
PROJ_DOC_SUBDIR
PROJ_CMAKE_SUBDIR )
PROJ_CMAKE_SUBDIR
)
set(DEFAULT_BINDIR "${PROJ_BIN_SUBDIR}")
set(DEFAULT_LIBDIR "${PROJ_LIB_SUBDIR}")
......@@ -72,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")
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 "")
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 )
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)
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)
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()
......@@ -12,8 +12,8 @@ function(proj_add_test_script_sh SH_NAME BIN_USE)
set(GRID_FULLNAME ${PROJECT_SOURCE_DIR}/data/${ARGV2})
if(EXISTS ${GRID_FULLNAME})
set(TEST_OK 1)
endif(EXISTS ${GRID_FULLNAME})
endif(ARGV2)
endif()
endif()
if(CMAKE_VERSION VERSION_LESS 2.8.4)
set(TEST_OK 0)
......@@ -26,9 +26,9 @@ function(proj_add_test_script_sh SH_NAME BIN_USE)
COMMAND ${PROJECT_SOURCE_DIR}/test/cli/${SH_NAME}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${${BIN_USE}}
)
endif(${TEST_OK})
endif()
endif(UNIX)
endif()
endfunction()
......
......@@ -66,8 +66,8 @@ endfunction()
# _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" HIWHITE "white" HIGRAY "gray" HIGREEN "green"
# HIRED "red" HIYELLOW "yellow" HIBLUE "blue" HIMAG "mag" HICYAN "cyan"
# "right?")
......@@ -98,7 +98,8 @@ 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.
......
......@@ -33,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
# 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()
......@@ -22,6 +22,9 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H 1
/* Define to 1 if you have the `strerror' function. */
#cmakedefine HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H 1
......
......@@ -5,6 +5,12 @@ set (PACKAGE_VERSION_MAJOR "@PROJ_VERSION_MAJOR@")
set (PACKAGE_VERSION_MINOR "@PROJ_VERSION_MINOR@")
set (PACKAGE_VERSION_PATCH "@PROJ_VERSION_PATCH@")
if (CMAKE_CROSSCOMPILING)
set (CMAKE_CROSSCOMPILING_STR "ON")
else ()
set (CMAKE_CROSSCOMPILING_STR "OFF")
endif ()
if (NOT PACKAGE_FIND_NAME STREQUAL "@PROJECT_NAME@")
# Check package name (in particular, because of the way cmake finds
# package config files, the capitalization could easily be "wrong").
......@@ -22,7 +28,7 @@ elseif (MSVC AND NOT MSVC_VERSION STREQUAL "@MSVC_VERSION@")
# Reject if there's a mismatch in MSVC compiler versions
set (REASON "_MSC_VER = @MSVC_VERSION@")
set (PACKAGE_VERSION_UNSUITABLE TRUE)
elseif (NOT CMAKE_CROSSCOMPILING STREQUAL "@CMAKE_CROSSCOMPILING@")
elseif (NOT CMAKE_CROSSCOMPILING_STR STREQUAL "@CMAKE_CROSSCOMPILING_STR@")
# Reject if there's a mismatch in ${CMAKE_CROSSCOMPILING}
set (REASON "cross-compiling = @CMAKE_CROSSCOMPILING@")
set (PACKAGE_VERSION_UNSUITABLE TRUE)
......@@ -46,3 +52,5 @@ endif ()
if (PACKAGE_VERSION_UNSUITABLE)
set (PACKAGE_VERSION "${PACKAGE_VERSION} (${REASON})")
endif ()
unset(CMAKE_CROSSCOMPILING_STR)
\ No newline at end of file
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for PROJ 6.0.0.
# Generated by GNU Autoconf 2.69 for PROJ 6.1.0.
#
# Report bugs to <https://github.com/OSGeo/proj.4/issues>.
#
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='PROJ'
PACKAGE_TARNAME='proj'
PACKAGE_VERSION='6.0.0'
PACKAGE_STRING='PROJ 6.0.0'
PACKAGE_VERSION='6.1.0'
PACKAGE_STRING='PROJ 6.1.0'
PACKAGE_BUGREPORT='https://github.com/OSGeo/proj.4/issues'
PACKAGE_URL='https://proj4.org'
 
......@@ -1348,7 +1348,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures PROJ 6.0.0 to adapt to many kinds of systems.
\`configure' configures PROJ 6.1.0 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1418,7 +1418,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of PROJ 6.0.0:";;
short | recursive ) echo "Configuration of PROJ 6.1.0:";;
esac
cat <<\_ACEOF
 
......@@ -1546,7 +1546,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
PROJ configure 6.0.0
PROJ configure 6.1.0
generated by GNU Autoconf 2.69
 
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2082,7 +2082,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by PROJ $as_me 6.0.0, which was
It was created by PROJ $as_me 6.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
$ $0 $@
......@@ -2953,7 +2953,7 @@ fi
 
# Define the identity of the package.
PACKAGE='proj'
VERSION='6.0.0'
VERSION='6.1.0'
 
 
cat >>confdefs.h <<_ACEOF
......@@ -18519,6 +18519,17 @@ $as_echo "#define HAVE_LOCALECONV 1" >>confdefs.h
 
fi
 
for ac_func in strerror
do :
ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror"
if test "x$ac_cv_func_strerror" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STRERROR 1
_ACEOF
fi
done
 
 
JNI_INCLUDE=
......@@ -18983,7 +18994,7 @@ if test "${with_external_gtest+set}" = set; then :
fi
 
 
if test "x$with_external_gtest" == "xyes" ; then
if test "x$with_external_gtest" = "xyes" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using external GTest." >&5
$as_echo "using external GTest." >&6; }
 
......@@ -19082,7 +19093,7 @@ $as_echo "using internal GTest." >&6; }
GTEST_CFLAGS="-I\$(top_srcdir)/test/googletest/include"
GTEST_LIBS="\$(top_builddir)/test/googletest/libgtest.la"
fi
if test "x$with_external_gtest" == "xyes"; then
if test "x$with_external_gtest" = "xyes"; then
USE_EXTERNAL_GTEST_TRUE=
USE_EXTERNAL_GTEST_FALSE='#'
else
......@@ -19643,7 +19654,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by PROJ $as_me 6.0.0, which was
This file was extended by PROJ $as_me 6.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -19710,7 +19721,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
PROJ config.status 6.0.0
PROJ config.status 6.1.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
 
......