Skip to content

Commit

Permalink
Merge pull request #928 from eressea/vcpkg
Browse files Browse the repository at this point in the history
Vcpkg
  • Loading branch information
ennorehling authored Feb 14, 2021
2 parents 30db209 + 729b316 commit 16b4a28
Show file tree
Hide file tree
Showing 58 changed files with 621 additions and 599 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
tolua/
.vscode/
*.orig
eressea.ini
Expand Down
12 changes: 3 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
[submodule "dlmalloc"]
path = dlmalloc
url = https://github.com/ennorehling/dlmalloc.git
[submodule "iniparser"]
path = iniparser
url = https://github.com/ennorehling/iniparser.git
[submodule "cJSON"]
path = cJSON
url = https://github.com/ennorehling/cJSON.git
[submodule "storage"]
path = storage
url = https://github.com/ennorehling/storage.git
branch = master
[submodule "clibs"]
path = clibs
url = https://github.com/ennorehling/clibs
[submodule "tolua"]
path = tolua
url = https://github.com/ennorehling/tolua.git
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
sudo: false
language: c
dist: focal
compiler:
- gcc
- clang
Expand All @@ -9,17 +10,15 @@ addons:
packages:
- libbsd-dev
- libdb-dev
- liblua5.1-dev
- libtolua-dev
- liblua5.3-dev
- libncurses5-dev
- libsqlite3-dev
- libexpat1-dev
- libiniparser-dev
- libcjson-dev
- valgrind
- cppcheck
- shellcheck
- luarocks
os:
- linux
notifications:
slack:
secure: F89aXLWaE125PaJIlETv12jT4EfH6wLXJmGCPZzrN3OcLn2ahDWqjwuzR7lOEDf2nAISmeMPyDZMhEHXLNHAE5qP6lg9yliYQw5hzGmDK9m1xUq/pPEne/b2Y7K3my1mkRZ6n3asbHgSmBWAfCIk1JN8R5Rv+rmbLuWLc+zofts=
53 changes: 24 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.9)
if (WIN32)
FILE(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH )
FILE(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH )
file(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH )
file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH )
endif(WIN32)

project (eressea-server C)
Expand All @@ -11,7 +11,7 @@ if (MSVC)
find_package (PDCurses)
set (CURSES_FOUND ${PDCURSES_FOUND})
set (CURSES_LIBRARIES ${PDCURSES_LIBRARY})
set (CURSES_INCLUDE_DIR ${PDCURSES_INCLUDE_DIR})
set (CURSES_INCLUDE_DIRS ${PDCURSES_INCLUDE_DIR})
set (HAVE_STRDUP 0)
set (HAVE_STRLCAT 0)
set (HAVE_LIBBSD 0)
Expand All @@ -20,49 +20,44 @@ set (HAVE_EXECINFO_H 0)
include (MSVC)
else (MSVC)

find_package (Curses)
include (CheckIncludeFile)
CHECK_INCLUDE_FILE(signal.h HAVE_SIGNAL_H)
CHECK_INCLUDE_FILE(execinfo.h HAVE_EXECINFO_H)
CHECK_INCLUDE_FILE(bsd/string.h HAVE_LIBBSD)
check_include_file(signal.h HAVE_SIGNAL_H)
check_include_file(execinfo.h HAVE_EXECINFO_H)

include (CheckLibraryExists)
check_library_exists(m sin "" HAVE_LIBM)
check_library_exists(bsd strlcat "" HAVE_LIBBSD)

include (CheckFunctionExists)
CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP)
check_function_exists(strdup HAVE_STRDUP)
check_function_exists(strlcat HAVE_STRLCAT)

if (HAVE_LIBBSD)
include (CheckLibraryExists)
CHECK_LIBRARY_EXISTS(bsd strlcat "bsd/string.h" HAVE_STRLCAT)
else (HAVE_LIBBSD)
CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT)
set (HAVE_STRLCAT 1)
endif (HAVE_LIBBSD)
endif (MSVC)

find_package (Readline)

if (ERESSEA_DB STREQUAL "db")
find_package (BerkeleyDB REQUIRED QUIET)
else()
find_package (SQLite3 REQUIRED QUIET)
endif()
if (NOT CURSES_FOUND)
find_package (Curses)
endif (NOT CURSES_FOUND)

find_package(EXPAT REQUIRED)
find_package (ToLua REQUIRED)
find_package (SQLite3 REQUIRED)
find_package (IniParser REQUIRED)
find_package (CJSON REQUIRED)
find_package (EXPAT REQUIRED)
if (TOLUA_FOUND)
if (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.3")
find_package (Lua 5.3 REQUIRED)
elseif (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.2")
if (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.2")
find_package (Lua 5.2 REQUIRED)
elseif (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.3")
find_package ( Lua 5.3 REQUIRED)
else ()
else()
find_package (Lua51 REQUIRED)
endif()
endif(TOLUA_FOUND)

enable_testing()

add_subdirectory (cJSON)
add_subdirectory (tolua)
add_subdirectory (tools)
add_subdirectory (storage)
add_subdirectory (iniparser)
add_subdirectory (clibs)
add_subdirectory (process)
add_subdirectory (src eressea)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Debian-based Linux system, this is the apt-get command to
install all of them:

sudo apt-get install git cmake gcc make luarocks libxml2-dev \
liblua5.2-dev libtolua-dev libncurses5-dev libsqlite3-dev
liblua5.2-dev libtolua-dev libncurses5-dev libsqlite3-dev \
libcjson-dev libiniparser-dev

# How to check out and build the Eressea server

Expand Down
1 change: 0 additions & 1 deletion cJSON
Submodule cJSON deleted from 460207
50 changes: 0 additions & 50 deletions cmake/Modules/FindBerkeleyDB.cmake

This file was deleted.

59 changes: 59 additions & 0 deletions cmake/Modules/FindCJSON.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

#[=======================================================================[.rst:
FindCJSON
-----------
.. versionadded:: 3.20
Find the cJSON libraries, v3
IMPORTED targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` target:
``DaveGamble::CJSON``
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables if found:
``CJSON_INCLUDE_DIRS``
where to find sqlite3.h, etc.
``CJSON_LIBRARIES``
the libraries to link against to use CJSON.
``CJSON_VERSION``
version of the CJSON library found
``CJSON_FOUND``
TRUE if found
#]=======================================================================]

# Look for the necessary header
find_path(CJSON_INCLUDE_DIR cJSON.h PATH_SUFFIXES cjson)
mark_as_advanced(CJSON_INCLUDE_DIR)

# Look for the necessary library
find_library(CJSON_LIBRARY cjson)
mark_as_advanced(CJSON_LIBRARY)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CJSON
REQUIRED_VARS CJSON_INCLUDE_DIR CJSON_LIBRARY
VERSION_VAR CJSON_VERSION)

# Create the imported target
if(CJSON_FOUND)
set(CJSON_INCLUDE_DIRS ${CJSON_INCLUDE_DIR})
set(CJSON_LIBRARIES ${CJSON_LIBRARY})
if(NOT TARGET DaveGamble::CJSON)
add_library(DaveGamble::CJSON UNKNOWN IMPORTED)
set_target_properties(DaveGamble::CJSON PROPERTIES
IMPORTED_LOCATION "${CJSON_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${CJSON_INCLUDE_DIR}")
endif()
endif()

59 changes: 59 additions & 0 deletions cmake/Modules/FindIniParser.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

#[=======================================================================[.rst:
FindIniParser
-----------
.. versionadded:: 3.20
Find the IniParser libraries, v3
IMPORTED targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` target:
``Devillard::IniParser``
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables if found:
``IniParser_INCLUDE_DIRS``
where to find sqlite3.h, etc.
``IniParser_LIBRARIES``
the libraries to link against to use IniParser.
``IniParser_VERSION``
version of the IniParser library found
``IniParser_FOUND``
TRUE if found
#]=======================================================================]

# Look for the necessary header
find_path(IniParser_INCLUDE_DIR iniparser.h PATH_SUFFIXES iniparser)
mark_as_advanced(IniParser_INCLUDE_DIR)

# Look for the necessary library
find_library(IniParser_LIBRARY iniparser)
mark_as_advanced(IniParser_LIBRARY)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IniParser
REQUIRED_VARS IniParser_INCLUDE_DIR IniParser_LIBRARY
VERSION_VAR IniParser_VERSION)

# Create the imported target
if(IniParser_FOUND)
set(IniParser_INCLUDE_DIRS ${IniParser_INCLUDE_DIR})
set(IniParser_LIBRARIES ${IniParser_LIBRARY})
if(NOT TARGET Devillard::IniParser)
add_library(Devillard::IniParser UNKNOWN IMPORTED)
set_target_properties(Devillard::IniParser PROPERTIES
IMPORTED_LOCATION "${IniParser_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${IniParser_INCLUDE_DIR}")
endif()
endif()

47 changes: 0 additions & 47 deletions cmake/Modules/FindReadline.cmake

This file was deleted.

Loading

0 comments on commit 16b4a28

Please sign in to comment.