Compare commits

...

11 Commits

7 changed files with 284 additions and 10 deletions

40
FindGeographicLib.cmake Normal file
View File

@ -0,0 +1,40 @@
# Look for GeographicLib
#
# Set
# GeographicLib_FOUND = GEOGRAPHICLIB_FOUND = TRUE
# GeographicLib_INCLUDE_DIRS = /usr/local/include
# GeographicLib_LIBRARIES = /usr/local/lib/libGeographic.so
# GeographicLib_LIBRARY_DIRS = /usr/local/lib
find_library (GeographicLib_LIBRARIES Geographic GeographicLib
PATHS "${CMAKE_INSTALL_PREFIX}/../GeographicLib/lib")
if (GeographicLib_LIBRARIES)
get_filename_component (GeographicLib_LIBRARY_DIRS
"${GeographicLib_LIBRARIES}" PATH)
get_filename_component (_ROOT_DIR "${GeographicLib_LIBRARY_DIRS}" PATH)
set (GeographicLib_INCLUDE_DIRS "${_ROOT_DIR}/include")
set (GeographicLib_BINARY_DIRS "${_ROOT_DIR}/bin")
if (NOT EXISTS "${GeographicLib_INCLUDE_DIRS}/GeographicLib/Config.h")
# On Debian systems the library is in e.g.,
# /usr/lib/x86_64-linux-gnu/libGeographic.so
# so try stripping another element off _ROOT_DIR
get_filename_component (_ROOT_DIR "${_ROOT_DIR}" PATH)
set (GeographicLib_INCLUDE_DIRS "${_ROOT_DIR}/include")
set (GeographicLib_BINARY_DIRS "${_ROOT_DIR}/bin")
if (NOT EXISTS "${GeographicLib_INCLUDE_DIRS}/GeographicLib/Config.h")
unset (GeographicLib_INCLUDE_DIRS)
unset (GeographicLib_LIBRARIES)
unset (GeographicLib_LIBRARY_DIRS)
unset (GeographicLib_BINARY_DIRS)
endif ()
endif ()
unset (_ROOT_DIR)
endif ()
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (GeographicLib DEFAULT_MSG
GeographicLib_LIBRARY_DIRS GeographicLib_LIBRARIES
GeographicLib_INCLUDE_DIRS)
mark_as_advanced (GeographicLib_LIBRARY_DIRS GeographicLib_LIBRARIES
GeographicLib_INCLUDE_DIRS)

75
FindGeos.cmake Normal file
View File

@ -0,0 +1,75 @@
set(GEOS_PREFIX "" CACHE PATH "The path to the prefix of an Geos installation")
find_path(GEOS_INCLUDE_DIR NAMES geos_c.h
PATHS
${GEOS_PREFIX}/include
/opt/local/include
/usr/include
/usr/local/include
)
find_library(GEOS_LIBRARIES NAMES geos_c
PATHS
${GEOS_PREFIX}/lib
/opt/local/lib
/usr/lib
/usr/local/lib
)
find_path(GEOSPP_INCLUDE_DIR NAMES geos/constants.h
PATHS
${GEOS_PREFIX}/include
/opt/local/include
/usr/include
/usr/local/include
)
find_library(GEOSPP_LIBRARIES NAMES geos
PATHS
${GEOS_PREFIX}/lib
/opt/local/lib
/usr/lib
/usr/local/lib
)
if(GEOS_INCLUDE_DIR AND GEOS_LIBRARIES AND NOT TARGET GEOS)
get_filename_component(GEOS_LIBRARY_DIR ${GEOS_LIBRARIES} PATH)
set(GEOS_FOUND TRUE)
add_library(Geos::Geos INTERFACE IMPORTED)
set_target_properties(Geos::Geos PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GEOS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${GEOS_LIBRARIES}"
)
endif()
if(GEOSPP_INCLUDE_DIR AND GEOSPP_LIBRARIES AND NOT TARGET GEOSPP)
get_filename_component(GEOSPP_LIBRARY_DIR ${GEOSPP_LIBRARIES} PATH)
set(GEOSPP_FOUND TRUE)
add_library(Geos::GeosPP INTERFACE IMPORTED)
set_target_properties(Geos::GeosPP PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GEOSPP_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${GEOSPP_LIBRARIES}"
)
endif()
if(GEOS_FOUND)
if(NOT GEOS_FIND_QUIETLY)
MESSAGE(STATUS "Found Geos: ${GEOS_LIBRARIES}")
endif()
set(HAVE_GEOS 1)
elseif(GEOS_FOUND)
if(GEOS_FIND_REQUIRED)
message(FATAL_ERROR "Could not find Geos")
endif()
endif()
if(GEOSPP_FOUND)
if(NOT GEOSP_FIND_QUIETLY)
MESSAGE(STATUS "Found Geos++: ${GEOSPP_LIBRARIES}")
endif()
set(HAVE_GEOSPP 1)
elseif(GEOSPP_FOUND)
if(GEOSPP_FIND_REQUIRED)
message(FATAL_ERROR "Could not find Geos++")
endif()
endif()

View File

@ -6,25 +6,26 @@ find_path(MATHGL_INCLUDE_DIR NAMES mgl2/mgl.h
/opt/local/include
/usr/include
/usr/local/include
)
)
find_library(MATHGL_LIBRARIES NAMES mgl mgl2
PATHS
${MATHGL_PREFIX}/lib
/opt/local/include
/usr/include
/usr/local/include
)
/opt/local/lib
/usr/lib
/usr/local/lib
)
find_library(MATHGL_QT5_LIBRARIES NAMES mgl-qt5 mgl2-qt5
PATHS
${MATHGL_PREFIX}/lib
/opt/local/include
/usr/include
/usr/local/include
)
/opt/local/lib
/usr/lib
/usr/local/lib
)
if(MATHGL_INCLUDE_DIR AND MATHGL_LIBRARIES AND NOT TARGET MathGL::Mgl AND NOT TARGET MathGL::Qt5)
if(MATHGL_INCLUDE_DIR AND MATHGL_LIBRARIES AND
NOT TARGET MathGL::Mgl AND NOT TARGET MathGL::Qt5)
get_filename_component(MATHGL_LIBRARY_DIR ${MATHGL_LIBRARIES} PATH)
set(MATHGL_FOUND TRUE)
add_library(MathGL::Mgl INTERFACE IMPORTED)

48
FindProj.cmake Normal file
View File

@ -0,0 +1,48 @@
set(PROJ_PREFIX "" CACHE PATH "The path to the prefix of an Proj installation")
find_path(PROJ_INCLUDE_DIR NAMES proj.h proj_api.h
PATHS
${PROJ_PREFIX}/include
/opt/local/include
/usr/include
/usr/local/include
)
find_library(PROJ_LIBRARIES NAMES proj
PATHS
${PROJ_PREFIX}/lib
/opt/local/lib
/usr/lib
/usr/local/lib
)
if(PROJ_INCLUDE_DIR AND PROJ_LIBRARIES AND NOT TARGET PROJ)
get_filename_component(PROJ_LIBRARY_DIR ${PROJ_LIBRARIES} PATH)
set(PROJ_FOUND TRUE)
add_library(Proj::Proj INTERFACE IMPORTED)
set_target_properties(Proj::Proj PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PROJ_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${PROJ_LIBRARIES}"
)
endif()
if(PROJ_FOUND)
if(NOT PROJ_FIND_QUIETLY)
MESSAGE(STATUS "Found Proj: ${PROJ_LIBRARIES}")
endif()
set(HAVE_PROJ 1)
if(EXISTS ${PROJ_INCLUDE_DIR}/proj.h)
file(READ ${PROJ_INCLUDE_DIR}/proj.h proj_version)
string(REGEX REPLACE "^.*PROJ_VERSION_MAJOR +([0-9]+).*$" "\\1" PROJ_VERSION_MAJOR "${proj_version}")
elseif(EXISTS ${PROJ_INCLUDE_DIR}/proj_api.h)
file(READ ${PROJ_INCLUDE_DIR}/proj_api.h proj_version)
string(REGEX REPLACE "^.*PJ_VERSION ([0-9]+).*$" "\\1" PJ_VERSION "${proj_version}")
string(REGEX REPLACE "([0-9])([0-9])([0-9])" "\\1" PROJ_VERSION_MAJOR "${PJ_VERSION}")
endif()
set(PROJ_VERSION_MAJOR "${PROJ_VERSION_MAJOR}" CACHE INTERNAL "")
elseif(PROJ_FOUND)
if(PROJ_FIND_REQUIRED)
message(FATAL_ERROR "Could not find Proj")
endif()
endif()

View File

@ -0,0 +1,30 @@
# - Try to find QtSingleApplication
# Once done this will define
#
# QTSINGLEAPPLICATION_FOUND - System has QtSingleApplication
# QTSINGLEAPPLICATION_INCLUDE_DIRS - QtSingleApplication include directories
# QTSINGLEAPPLICATION_LIBRARIES - Link these to use QtSingleApplication
# QTSINGLEAPPLICATION_DEFINITIONS - Compiler switches required for using QtSingleApplication
# Copyright (C) 2010 Tanguy Krotoff <tkrotoff@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
set(QTSINGLEAPPLICATION_DEFINITIONS -DQT_QTSINGLEAPPLICATION_IMPORT)
find_path(QTSINGLEAPPLICATION_INCLUDE_DIRS
NAMES
QtSingleApplication
PATHS
/usr/include/x86_64-linux-gnu/qt5/QtSolutions
)
find_library(QTSINGLEAPPLICATION_LIBRARIES
NAMES
Qt5Solutions_SingleApplication-head
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(QtSingleApplication DEFAULT_MSG QTSINGLEAPPLICATION_INCLUDE_DIRS QTSINGLEAPPLICATION_LIBRARIES)

41
FindQwt.cmake Normal file
View File

@ -0,0 +1,41 @@
set(QWT_PREFIX "" CACHE PATH "The path to the prefix of an Qwt installation")
find_path(QWT_INCLUDE_DIR NAMES qwt.h
PATHS
${QWT_PREFIX}/include
/opt/local/include
/usr/include
/usr/local/include
PATH_SUFFIXES qwt-qt5 qwt qwt6
)
find_library(QWT_LIBRARIES NAMES qwt-qt5 qwt6-qt5 qwt qwt6
PATHS
${QWT_PREFIX}/lib
/opt/local/lib
/usr/lib
/usr/local/lib
)
if(QWT_INCLUDE_DIR AND QWT_LIBRARIES AND NOT TARGET Qwt::Qwt)
get_filename_component(QWT_LIBRARY_DIR ${QWT_LIBRARIES} PATH)
set(QWT_FOUND TRUE)
add_library(Qwt::Qwt INTERFACE IMPORTED)
set_target_properties(Qwt::Qwt PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${QWT_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${QWT_LIBRARIES}"
)
endif()
if(QWT_FOUND)
file(READ ${QWT_INCLUDE_DIR}/qwt_global.h qwt_header)
string(REGEX REPLACE "^.*QWT_VERSION_STR +\"([^\"]+)\".*$" "\\1" QWT_VERSION_STR "${qwt_header}")
if(NOT QWT_FIND_QUIETLY)
message(STATUS "Found Qwt: ${QWT_LIBRARY} (${QWT_VERSION_STR})")
endif(NOT QWT_FIND_QUIETLY)
else(QWT_FOUND)
if(QWT_FIND_REQUIRED)
message(FATAL_ERROR "Could not find Qwt")
endif(QWT_FIND_REQUIRED)
endif(QWT_FOUND)

39
FindSQLite3.cmake Normal file
View File

@ -0,0 +1,39 @@
set(SQLite3_PREFIX "" CACHE PATH "The path to the prefix of SQLite3 installation")
find_path(SQLite3_INCLUDE_DIR NAMES sqlite3.h
PATHS
${SQLite3_PREFIX}/include
/opt/local/include
/usr/include
/usr/local/include
)
find_library(SQLite3_LIBRARIES NAMES sqlite3
PATHS
${SQLite3_PREFIX}/lib
/opt/local/lib
/usr/lib
/usr/local/lib
)
if(SQLite3_INCLUDE_DIR AND SQLite3_LIBRARIES AND NOT TARGET SQLite::SQlite3)
get_filename_component(SQLite3_LIBRARY_DIR ${SQLite3_LIBRARIES} PATH)
set(SQLite3_FOUND TRUE)
set(SQLite3_INCLUDE_DIRS ${SQLite3_INCLUDE_DIR})
add_library(SQLite::SQLite3 INTERFACE IMPORTED)
set_target_properties(SQLite::SQLite3 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${SQLite3_LIBRARIES}"
)
endif()
# Extract version information from the header file
if(SQLite3_FOUND)
file(STRINGS ${SQLite3_INCLUDE_DIR}/sqlite3.h _ver_line
REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\""
LIMIT_COUNT 1)
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
SQLite3_VERSION "${_ver_line}")
unset(_ver_line)
endif()