Initial commit
This commit is contained in:
commit
d17500a3b0
18 changed files with 938 additions and 0 deletions
63
cmake_modules/FindJsoncpp.cmake
Normal file
63
cmake_modules/FindJsoncpp.cmake
Normal file
|
@ -0,0 +1,63 @@
|
|||
# Find jsoncpp
|
||||
#
|
||||
# Find the jsoncpp includes and library
|
||||
#
|
||||
# if you nee to add a custom library search path, do it via via CMAKE_PREFIX_PATH
|
||||
#
|
||||
# This module defines
|
||||
# JSONCPP_INCLUDE_DIRS, where to find header, etc.
|
||||
# JSONCPP_LIBRARIES, the libraries needed to use jsoncpp.
|
||||
# JSONCPP_FOUND, If false, do not try to use jsoncpp.
|
||||
# JSONCPP_INCLUDE_PREFIX, include prefix for jsoncpp
|
||||
|
||||
# only look in default directories
|
||||
find_path(
|
||||
JSONCPP_INCLUDE_DIR
|
||||
NAMES jsoncpp/json/json.h json/json.h
|
||||
DOC "jsoncpp include dir"
|
||||
)
|
||||
|
||||
find_library(
|
||||
JSONCPP_LIBRARY
|
||||
NAMES jsoncpp
|
||||
DOC "jsoncpp library"
|
||||
)
|
||||
|
||||
set(JSONCPP_INCLUDE_DIRS ${JSONCPP_INCLUDE_DIR})
|
||||
set(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY})
|
||||
|
||||
# debug library on windows
|
||||
# same naming convention as in qt (appending debug library with d)
|
||||
# boost is using the same "hack" as us with "optimized" and "debug"
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
find_library(
|
||||
JSONCPP_LIBRARY_DEBUG
|
||||
NAMES jsoncppd
|
||||
DOC "jsoncpp debug library"
|
||||
)
|
||||
|
||||
set(JSONCPP_LIBRARIES optimized ${JSONCPP_LIBRARIES} debug ${JSONCPP_LIBRARY_DEBUG})
|
||||
|
||||
endif()
|
||||
|
||||
# find JSONCPP_INCLUDE_PREFIX
|
||||
find_path(
|
||||
JSONCPP_INCLUDE_PREFIX
|
||||
NAMES json.h
|
||||
PATH_SUFFIXES jsoncpp/json json
|
||||
)
|
||||
|
||||
if (${JSONCPP_INCLUDE_PREFIX} MATCHES "jsoncpp")
|
||||
set(JSONCPP_INCLUDE_PREFIX "jsoncpp")
|
||||
set(JSONCPP_INCLUDE_DIRS "${JSONCPP_INCLUDE_DIRS}/jsoncpp")
|
||||
else()
|
||||
set(JSONCPP_INCLUDE_PREFIX "")
|
||||
endif()
|
||||
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set JSONCPP_FOUND to TRUE
|
||||
# if all listed variables are TRUE, hide their existence from configuration view
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(jsoncpp DEFAULT_MSG
|
||||
JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY)
|
||||
mark_as_advanced (JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY)
|
114
cmake_modules/FindMySQL.cmake
Normal file
114
cmake_modules/FindMySQL.cmake
Normal file
|
@ -0,0 +1,114 @@
|
|||
#--------------------------------------------------------
|
||||
# Copyright (C) 1995-2007 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of version 2 of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# There are special exceptions to the terms and conditions of the GPL
|
||||
# as it is applied to this software. View the full text of the exception
|
||||
# in file LICENSE.exceptions in the top-level directory of this software
|
||||
# distribution.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
#
|
||||
# The MySQL Connector/ODBC is licensed under the terms of the
|
||||
# GPL, like most MySQL Connectors. There are special exceptions
|
||||
# to the terms and conditions of the GPL as it is applied to
|
||||
# this software, see the FLOSS License Exception available on
|
||||
# mysql.com.
|
||||
|
||||
##########################################################################
|
||||
|
||||
|
||||
#-------------- FIND MYSQL_INCLUDE_DIR ------------------
|
||||
FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
|
||||
/usr/include/mysql
|
||||
/usr/local/include/mysql
|
||||
/opt/mysql/mysql/include
|
||||
/opt/mysql/mysql/include/mysql
|
||||
/opt/mysql/include
|
||||
/opt/local/include/mysql5
|
||||
/usr/local/mysql/include
|
||||
/usr/local/mysql/include/mysql
|
||||
$ENV{ProgramFiles}/MySQL/*/include
|
||||
$ENV{SystemDrive}/MySQL/*/include)
|
||||
|
||||
#----------------- FIND MYSQL_LIB_DIR -------------------
|
||||
IF (WIN32)
|
||||
# Set lib path suffixes
|
||||
# dist = for mysql binary distributions
|
||||
# build = for custom built tree
|
||||
IF (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
SET(libsuffixDist debug)
|
||||
SET(libsuffixBuild Debug)
|
||||
ELSE (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
SET(libsuffixDist opt)
|
||||
SET(libsuffixBuild Release)
|
||||
ADD_DEFINITIONS(-DDBUG_OFF)
|
||||
ENDIF (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
|
||||
FIND_LIBRARY(MYSQL_LIB NAMES mysqlclient
|
||||
PATHS
|
||||
$ENV{MYSQL_DIR}/lib/${libsuffixDist}
|
||||
$ENV{MYSQL_DIR}/libmysql
|
||||
$ENV{MYSQL_DIR}/libmysql/${libsuffixBuild}
|
||||
$ENV{MYSQL_DIR}/client/${libsuffixBuild}
|
||||
$ENV{MYSQL_DIR}/libmysql/${libsuffixBuild}
|
||||
$ENV{ProgramFiles}/MySQL/*/lib/${libsuffixDist}
|
||||
$ENV{SystemDrive}/MySQL/*/lib/${libsuffixDist})
|
||||
ELSE (WIN32)
|
||||
FIND_LIBRARY(MYSQL_LIB NAMES mysqlclient_r mariadbclient
|
||||
PATHS
|
||||
/usr/lib/mysql
|
||||
/usr/local/lib/mysql
|
||||
/usr/local/mysql/lib
|
||||
/usr/local/mysql/lib/mysql
|
||||
/opt/local/mysql5/lib
|
||||
/opt/local/lib/mysql5/mysql
|
||||
/opt/mysql/mysql/lib/mysql
|
||||
/opt/mysql/lib/mysql)
|
||||
ENDIF (WIN32)
|
||||
|
||||
IF(MYSQL_LIB)
|
||||
GET_FILENAME_COMPONENT(MYSQL_LIB_DIR ${MYSQL_LIB} PATH)
|
||||
ENDIF(MYSQL_LIB)
|
||||
|
||||
set(MYSQL_VERSION_STRING "")
|
||||
|
||||
EXEC_PROGRAM (grep ARGS "MARIADB_BASE_VERSION ${MYSQL_INCLUDE_DIR}/*.h|awk '{print $3}'" OUTPUT_VARIABLE MYSQL_VERSION_STRING)
|
||||
|
||||
IF (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR)
|
||||
SET(MYSQL_FOUND TRUE)
|
||||
|
||||
FIND_LIBRARY(MYSQL_ZLIB zlib PATHS ${MYSQL_LIB_DIR})
|
||||
FIND_LIBRARY(MYSQL_TAOCRYPT taocrypt PATHS ${MYSQL_LIB_DIR})
|
||||
IF (MYSQL_LIB)
|
||||
SET(MYSQL_CLIENT_LIBS ${MYSQL_LIB})
|
||||
ELSE()
|
||||
SET(MYSQL_CLIENT_LIBS mysqlclient_r)
|
||||
ENDIF()
|
||||
IF (MYSQL_ZLIB)
|
||||
SET(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} zlib)
|
||||
ENDIF (MYSQL_ZLIB)
|
||||
IF (MYSQL_TAOCRYPT)
|
||||
SET(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} taocrypt)
|
||||
ENDIF (MYSQL_TAOCRYPT)
|
||||
# Added needed mysqlclient dependencies on Windows
|
||||
IF (WIN32)
|
||||
SET(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} ws2_32)
|
||||
ENDIF (WIN32)
|
||||
|
||||
MESSAGE(STATUS "MySQL Include dir: ${MYSQL_INCLUDE_DIR} library dir: ${MYSQL_LIB_DIR}")
|
||||
MESSAGE(STATUS "MySQL client libraries: ${MYSQL_CLIENT_LIBS}")
|
||||
ELSEIF (MySQL_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Cannot find MySQL. Include dir: ${MYSQL_INCLUDE_DIR} library dir: ${MYSQL_LIB_DIR}")
|
||||
ENDIF (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR)
|
37
cmake_modules/FindSQLite3.cmake
Normal file
37
cmake_modules/FindSQLite3.cmake
Normal file
|
@ -0,0 +1,37 @@
|
|||
# Copyright (C) 2007-2009 LuaDist.
|
||||
# Created by Peter Kapec <kapecp@gmail.com>
|
||||
# Redistribution and use of this file is allowed according to the terms of the MIT license.
|
||||
# For details see the COPYRIGHT file distributed with LuaDist.
|
||||
# Note:
|
||||
# Searching headers and libraries is very simple and is NOT as powerful as scripts
|
||||
# distributed with CMake, because LuaDist defines directories to search for.
|
||||
# Everyone is encouraged to contact the author with improvements. Maybe this file
|
||||
# becomes part of CMake distribution sometimes.
|
||||
|
||||
# - Find sqlite3
|
||||
# Find the native SQLITE3 headers and libraries.
|
||||
#
|
||||
# SQLITE3_INCLUDE_DIRS - where to find sqlite3.h, etc.
|
||||
# SQLITE3_LIBRARIES - List of libraries when using sqlite.
|
||||
# SQLITE3_FOUND - True if sqlite found.
|
||||
|
||||
# Look for the header file.
|
||||
FIND_PATH(SQLITE3_INCLUDE_DIR NAMES sqlite3.h)
|
||||
|
||||
# Look for the library.
|
||||
FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set SQLITE3_FOUND to TRUE if all listed variables are TRUE.
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SQLITE3 DEFAULT_MSG SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)
|
||||
|
||||
# Copy the results to the output variables.
|
||||
IF(SQLITE3_FOUND)
|
||||
SET(SQLITE3_LIBRARIES ${SQLITE3_LIBRARY})
|
||||
SET(SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDE_DIR})
|
||||
ELSE(SQLITE3_FOUND)
|
||||
SET(SQLITE3_LIBRARIES)
|
||||
SET(SQLITE3_INCLUDE_DIRS)
|
||||
ENDIF(SQLITE3_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)
|
119
cmake_modules/FindUUID.cmake
Normal file
119
cmake_modules/FindUUID.cmake
Normal file
|
@ -0,0 +1,119 @@
|
|||
# - Try to find UUID
|
||||
# Once done this will define
|
||||
#
|
||||
# UUID_FOUND - system has UUID
|
||||
# UUID_INCLUDE_DIRS - the UUID include directory
|
||||
# UUID_LIBRARIES - Link these to use UUID
|
||||
# UUID_DEFINITIONS - Compiler switches required for using UUID
|
||||
#
|
||||
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
|
||||
if (UUID_LIBRARIES AND UUID_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(UUID_FOUND TRUE)
|
||||
else (UUID_LIBRARIES AND UUID_INCLUDE_DIRS)
|
||||
find_path(UUID_INCLUDE_DIR
|
||||
NAMES
|
||||
uuid.h
|
||||
PATH_SUFFIXES
|
||||
uuid
|
||||
HINTS
|
||||
${UUID_DIR}/include
|
||||
$ENV{UUID_DIR}/include
|
||||
$ENV{UUID_DIR}
|
||||
${DELTA3D_EXT_DIR}/inc
|
||||
$ENV{DELTA_ROOT}/ext/inc
|
||||
$ENV{DELTA_ROOT}
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/usr/include/gdal
|
||||
/sw/include # Fink
|
||||
/opt/local/include # DarwinPorts
|
||||
/opt/csw/include # Blastwave
|
||||
/opt/include
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||
/usr/freeware/include
|
||||
)
|
||||
|
||||
find_library(UUID_LIBRARY
|
||||
NAMES
|
||||
uuid ossp-uuid
|
||||
HINTS
|
||||
${UUID_DIR}/lib
|
||||
$ENV{UUID_DIR}/lib
|
||||
$ENV{UUID_DIR}
|
||||
${DELTA3D_EXT_DIR}/lib
|
||||
$ENV{DELTA_ROOT}/ext/lib
|
||||
$ENV{DELTA_ROOT}
|
||||
$ENV{OSG_ROOT}/lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
find_library(UUID_LIBRARY_DEBUG
|
||||
NAMES
|
||||
uuidd
|
||||
HINTS
|
||||
${UUID_DIR}/lib
|
||||
$ENV{UUID_DIR}/lib
|
||||
$ENV{UUID_DIR}
|
||||
${DELTA3D_EXT_DIR}/lib
|
||||
$ENV{DELTA_ROOT}/ext/lib
|
||||
$ENV{DELTA_ROOT}
|
||||
$ENV{OSG_ROOT}/lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
if (NOT UUID_LIBRARY AND BSD)
|
||||
set(UUID_LIBRARY "")
|
||||
endif(NOT UUID_LIBRARY AND BSD)
|
||||
|
||||
set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR})
|
||||
set(UUID_LIBRARIES ${UUID_LIBRARY})
|
||||
|
||||
if (UUID_INCLUDE_DIRS)
|
||||
if (BSD OR UUID_LIBRARIES)
|
||||
set(UUID_FOUND TRUE)
|
||||
endif (BSD OR UUID_LIBRARIES)
|
||||
endif (UUID_INCLUDE_DIRS)
|
||||
|
||||
if (UUID_FOUND)
|
||||
if (NOT UUID_FIND_QUIETLY)
|
||||
message(STATUS "Found UUID: ${UUID_LIBRARIES}")
|
||||
endif (NOT UUID_FIND_QUIETLY)
|
||||
else (UUID_FOUND)
|
||||
if (UUID_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find UUID")
|
||||
endif (UUID_FIND_REQUIRED)
|
||||
endif (UUID_FOUND)
|
||||
|
||||
# show the UUID_INCLUDE_DIRS and UUID_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(UUID_INCLUDE_DIRS UUID_LIBRARIES)
|
||||
|
||||
endif (UUID_LIBRARIES AND UUID_INCLUDE_DIRS)
|
Loading…
Add table
Add a link
Reference in a new issue