[games-server/ghost++] initial import, still not finished (and only compile tested) uses cmake as we have a dep on it anyway.
This commit is contained in:
120
games-server/ghost++/files/cmake/modules/FindMySQL.cmake
Normal file
120
games-server/ghost++/files/cmake/modules/FindMySQL.cmake
Normal file
@@ -0,0 +1,120 @@
|
||||
#--------------------------------------------------------
|
||||
# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved
|
||||
#
|
||||
# The MySQL Connector/ODBC is licensed under the terms of the GPLv2
|
||||
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
|
||||
# MySQL Connectors. There are special exceptions to the terms and
|
||||
# conditions of the GPLv2 as it is applied to this software, see the
|
||||
# FLOSS License Exception
|
||||
# <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# 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 St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
##########################################################################
|
||||
|
||||
|
||||
#-------------- FIND MYSQL_INCLUDE_DIR ------------------
|
||||
FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
|
||||
$ENV{MYSQL_INCLUDE_DIR}
|
||||
$ENV{MYSQL_DIR}/include
|
||||
/usr/include/mysql
|
||||
/usr/local/include/mysql
|
||||
/opt/mysql/mysql/include
|
||||
/opt/mysql/mysql/include/mysql
|
||||
/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}/lib
|
||||
$ENV{MYSQL_DIR}/libmysql
|
||||
$ENV{MYSQL_DIR}/lib
|
||||
$ENV{MYSQL_DIR}/libmysql/${libsuffixBuild}
|
||||
$ENV{MYSQL_DIR}/client/${libsuffixBuild}
|
||||
$ENV{MYSQL_DIR}/libmysql/${libsuffixBuild}
|
||||
$ENV{ProgramFiles}/MySQL/*/lib/${libsuffixDist}
|
||||
$ENV{ProgramFiles}/MySQL/*/lib
|
||||
$ENV{SystemDrive}/MySQL/*/lib/${libsuffixDist})
|
||||
ELSE (WIN32)
|
||||
FIND_LIBRARY(MYSQL_LIB NAMES mysqlclient_r
|
||||
PATHS
|
||||
$ENV{MYSQL_DIR}/libmysql_r/.libs
|
||||
$ENV{MYSQL_DIR}/lib
|
||||
$ENV{MYSQL_DIR}/lib/mysql
|
||||
/usr/lib/mysql
|
||||
/usr/local/lib/mysql
|
||||
/usr/local/mysql/lib
|
||||
/usr/local/mysql/lib/mysql
|
||||
/opt/mysql/mysql/lib
|
||||
/opt/mysql/mysql/lib/mysql)
|
||||
ENDIF (WIN32)
|
||||
|
||||
IF(MYSQL_LIB)
|
||||
GET_FILENAME_COMPONENT(MYSQL_LIB_DIR ${MYSQL_LIB} PATH)
|
||||
ENDIF(MYSQL_LIB)
|
||||
|
||||
IF (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR)
|
||||
SET(MYSQL_FOUND TRUE)
|
||||
|
||||
INCLUDE_DIRECTORIES(${MYSQL_INCLUDE_DIR})
|
||||
LINK_DIRECTORIES(${MYSQL_LIB_DIR})
|
||||
|
||||
FIND_LIBRARY(MYSQL_ZLIB zlib PATHS ${MYSQL_LIB_DIR})
|
||||
FIND_LIBRARY(MYSQL_YASSL yassl PATHS ${MYSQL_LIB_DIR})
|
||||
FIND_LIBRARY(MYSQL_TAOCRYPT taocrypt PATHS ${MYSQL_LIB_DIR})
|
||||
IF (WIN32)
|
||||
SET(MYSQL_CLIENT_LIBS mysqlclient)
|
||||
ELSE (WIN32)
|
||||
SET(MYSQL_CLIENT_LIBS mysqlclient_r)
|
||||
ENDIF (WIN32)
|
||||
IF (MYSQL_ZLIB)
|
||||
SET(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} zlib)
|
||||
ENDIF (MYSQL_ZLIB)
|
||||
IF (MYSQL_YASSL)
|
||||
SET(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} yassl)
|
||||
ENDIF (MYSQL_YASSL)
|
||||
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)
|
||||
ELSE (WIN32)
|
||||
FIND_PACKAGE(Threads)
|
||||
SET(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
ENDIF (WIN32)
|
||||
|
||||
MESSAGE(STATUS "MySQL Include dir: ${MYSQL_INCLUDE_DIR} library dir: ${MYSQL_LIB_DIR}")
|
||||
MESSAGE(STATUS "MySQL client libraries: ${MYSQL_CLIENT_LIBS}")
|
||||
ELSE (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR)
|
||||
MESSAGE(FATAL_ERROR "Cannot find MySQL. Include dir: ${MYSQL_INCLUDE_DIR} library dir: ${MYSQL_LIB_DIR}")
|
||||
ENDIF (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR)
|
||||
|
||||
50
games-server/ghost++/files/cmake/modules/FindSqlite.cmake
Normal file
50
games-server/ghost++/files/cmake/modules/FindSqlite.cmake
Normal file
@@ -0,0 +1,50 @@
|
||||
# - Try to find Sqlite
|
||||
# Once done this will define
|
||||
#
|
||||
# SQLITE_FOUND - system has Sqlite
|
||||
# SQLITE_INCLUDE_DIR - the Sqlite include directory
|
||||
# SQLITE_LIBRARIES - Link these to use Sqlite
|
||||
# SQLITE_DEFINITIONS - Compiler switches required for using Sqlite
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
|
||||
# Copyright (c) 2008, Gilles Caulier, <caulier.gilles@gmail.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
if ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES )
|
||||
# in cache already
|
||||
SET(Sqlite_FIND_QUIETLY TRUE)
|
||||
endif ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES )
|
||||
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
if( NOT WIN32 )
|
||||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules(PC_SQLITE QUIET sqlite3)
|
||||
|
||||
set(SQLITE_DEFINITIONS ${PC_SQLITE_CFLAGS_OTHER})
|
||||
endif( NOT WIN32 )
|
||||
|
||||
find_path(SQLITE_INCLUDE_DIR NAMES sqlite3.h
|
||||
PATHS
|
||||
${PC_SQLITE_INCLUDEDIR}
|
||||
${PC_SQLITE_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
find_library(SQLITE_LIBRARIES NAMES sqlite3
|
||||
PATHS
|
||||
${PC_SQLITE_LIBDIR}
|
||||
${PC_SQLITE_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR SQLITE_LIBRARIES )
|
||||
|
||||
# show the SQLITE_INCLUDE_DIR and SQLITE_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(SQLITE_INCLUDE_DIR SQLITE_LIBRARIES )
|
||||
|
||||
23
games-server/ghost++/files/cmake/modules/FindStormLib.cmake
Normal file
23
games-server/ghost++/files/cmake/modules/FindStormLib.cmake
Normal file
@@ -0,0 +1,23 @@
|
||||
# - Find StormLib
|
||||
# Find StormLib headers and libraries.
|
||||
#
|
||||
# StormLib_INCLUDE_DIR - where to find StormLib.h, etc.
|
||||
# StormLib_LIBRARY - List of libraries when using StormLib.
|
||||
# StormLib_FOUND - True if StormLib found.
|
||||
|
||||
# Look for the header file.
|
||||
FIND_PATH( StormLib_INCLUDE_DIR NAMES StormLib.h
|
||||
PATHS /usr/include /usr/local/include)
|
||||
MARK_AS_ADVANCED(StormLib_INCLUDE_DIR)
|
||||
|
||||
# Look for the library.
|
||||
FIND_LIBRARY( StormLib_LIBRARY NAMES storm
|
||||
PATHS /usr/lib /usr/lib64 )
|
||||
MARK_AS_ADVANCED(StormLib_LIBRARY)
|
||||
|
||||
# Copy the results to the output variables.
|
||||
IF(StormLib_INCLUDE_DIR AND StormLib_LIBRARY)
|
||||
SET(StormLib_FOUND 1)
|
||||
ELSE(StormLib_INCLUDE_DIR AND StormLib_LIBRARY)
|
||||
SET(StormLib_FOUND 0)
|
||||
ENDIF(StormLib_INCLUDE_DIR AND StormLib_LIBRARY)
|
||||
23
games-server/ghost++/files/cmake/modules/Findbncsutil.cmake
Normal file
23
games-server/ghost++/files/cmake/modules/Findbncsutil.cmake
Normal file
@@ -0,0 +1,23 @@
|
||||
# - Find bncsutil
|
||||
# Find bncsutil headers and libraries.
|
||||
#
|
||||
# bncsutil_INCLUDE_DIR - where to find bncsutil.h, etc.
|
||||
# bncsutil_LIBRARY - List of libraries when using bncsutil.
|
||||
# bncsutil_FOUND - True if bncsutil found.
|
||||
|
||||
# Look for the header file.
|
||||
FIND_PATH( bncsutil_INCLUDE_DIR NAMES bncsutil.h
|
||||
PATHS /usr/include/bncsutil /usr/local/include/bncsutil)
|
||||
MARK_AS_ADVANCED(bncsutil_INCLUDE_DIR)
|
||||
|
||||
# Look for the library.
|
||||
FIND_LIBRARY( bncsutil_LIBRARY NAMES bncsutil
|
||||
PATHS /usr/lib /usr/lib64 )
|
||||
MARK_AS_ADVANCED(bncsutil_LIBRARY)
|
||||
|
||||
# Copy the results to the output variables.
|
||||
IF(bncsutil_INCLUDE_DIR AND bncsutil_LIBRARY)
|
||||
SET(bncsutil_FOUND 1)
|
||||
ELSE(bncsutil_INCLUDE_DIR AND bncsutil_LIBRARY)
|
||||
SET(bncsutil_FOUND 0)
|
||||
ENDIF(bncsutil_INCLUDE_DIR AND bncsutil_LIBRARY)
|
||||
Reference in New Issue
Block a user