aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-11-14 17:40:42 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-11-14 22:48:29 +0100
commitd928db15d53805d9b728b440079756081961c536 (patch)
treee862a961d26bedb34c58e4f28ef0bdeedb5f3225 /cmake
parent330e8bf686f9c4524075ca1ff50cbca6c9e091da (diff)
downloadPROJ-d928db15d53805d9b728b440079756081961c536.tar.gz
PROJ-d928db15d53805d9b728b440079756081961c536.zip
Implement RFC 2: Initial integration of "GDAL SRS barn" work
This work mostly consists of: - a C++ implementation of the ISO-19111:2018 / OGC Topic 2 "Referencing by coordinates" classes to represent Datums, Coordinate systems, CRSs (Coordinate Reference Systems) and Coordinate Operations. - methods to convert between this C++ modeling and WKT1, WKT2 and PROJ string representations of those objects - management and query of a SQLite3 database of CRS and Coordinate Operation definition - a C API binding part of those capabilities This is all-in-one squashed commit of the work of https://github.com/OSGeo/proj.4/pull/1040
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindSqlite3.cmake66
-rw-r--r--cmake/Makefile.am3
2 files changed, 68 insertions, 1 deletions
diff --git a/cmake/FindSqlite3.cmake b/cmake/FindSqlite3.cmake
new file mode 100644
index 00000000..4ac079c4
--- /dev/null
+++ b/cmake/FindSqlite3.cmake
@@ -0,0 +1,66 @@
+# 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 (SQLITE3_LIBRARY)
+ SET (CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_save} CACHE STRING "" FORCE)
+ ENDIF ()
+ENDIF (APPLE)
+
+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 (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
+
+IF (SQLITE3_FOUND)
+ IF (NOT SQLITE3_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Sqlite3: ${SQLITE3_LIBRARY}")
+ ENDIF (NOT SQLITE3_FIND_QUIETLY)
+
+ELSE (SQLITE3_FOUND)
+
+ IF (SQLITE3_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find Sqlite3")
+ ENDIF (SQLITE3_FIND_REQUIRED)
+
+ENDIF (SQLITE3_FOUND)
diff --git a/cmake/Makefile.am b/cmake/Makefile.am
index 14ce7af6..c2799f3a 100644
--- a/cmake/Makefile.am
+++ b/cmake/Makefile.am
@@ -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