diff --git a/CMakeLists.txt b/CMakeLists.txt index 23796c6c0..19aa5ab52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,24 +36,14 @@ CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT) 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() +find_package (SQLite3 REQUIRED) find_package(EXPAT REQUIRED) find_package (ToLua 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) diff --git a/cmake/Modules/FindBerkeleyDB.cmake b/cmake/Modules/FindBerkeleyDB.cmake deleted file mode 100644 index 88b0621fe..000000000 --- a/cmake/Modules/FindBerkeleyDB.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# -*- cmake -*- - -# - Find BerkeleyDB -# Find the BerkeleyDB includes and library -# This module defines -# DB_INCLUDE_DIR, where to find db.h, etc. -# DB_LIBRARIES, the libraries needed to use BerkeleyDB. -# DB_FOUND, If false, do not try to use BerkeleyDB. -# also defined, but not for general use are -# DB_LIBRARY, where to find the BerkeleyDB library. - -FIND_PATH(DB_INCLUDE_DIR db.h - /usr/local/include/db4 - /usr/local/include - /usr/include/db4 - /usr/include - ) - -SET(DB_NAMES ${DB_NAMES} db) -FIND_LIBRARY(DB_LIBRARY - NAMES ${DB_NAMES} - PATHS /usr/lib /usr/local/lib - ) - -IF (DB_LIBRARY AND DB_INCLUDE_DIR) - SET(DB_LIBRARIES ${DB_LIBRARY}) - SET(DB_FOUND "YES") -ELSE (DB_LIBRARY AND DB_INCLUDE_DIR) - SET(DB_FOUND "NO") -ENDIF (DB_LIBRARY AND DB_INCLUDE_DIR) - - -IF (DB_FOUND) - IF (NOT DB_FIND_QUIETLY) - MESSAGE(STATUS "Found BerkeleyDB: ${DB_LIBRARIES}") - ENDIF (NOT DB_FIND_QUIETLY) -ELSE (DB_FOUND) - IF (DB_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find BerkeleyDB library") - ENDIF (DB_FIND_REQUIRED) -ENDIF (DB_FOUND) - -# Deprecated declarations. -SET (NATIVE_DB_INCLUDE_PATH ${DB_INCLUDE_DIR} ) -GET_FILENAME_COMPONENT (NATIVE_DB_LIB_PATH ${DB_LIBRARY} PATH) - -MARK_AS_ADVANCED( - DB_LIBRARY - DB_INCLUDE_DIR - ) diff --git a/cmake/Modules/FindReadline.cmake b/cmake/Modules/FindReadline.cmake deleted file mode 100644 index bb73fee7f..000000000 --- a/cmake/Modules/FindReadline.cmake +++ /dev/null @@ -1,47 +0,0 @@ -# - Try to find readline include dirs and libraries -# -# Usage of this module as follows: -# -# find_package(Readline) -# -# Variables used by this module, they can change the default behaviour and need -# to be set before calling find_package: -# -# READLINE_ROOT_DIR Set this variable to the root installation of -# readline if the module has problems finding the -# proper installation path. -# -# Variables defined by this module: -# -# READLINE_FOUND System has readline, include and lib dirs found -# READLINE_INCLUDE_DIR The readline include directories. -# READLINE_LIBRARY The readline library. - -find_path(READLINE_ROOT_DIR - NAMES include/readline/readline.h -) - -find_path(READLINE_INCLUDE_DIR - NAMES readline/readline.h - HINTS ${READLINE_ROOT_DIR}/include -) - -find_library(READLINE_LIBRARY - NAMES readline - HINTS ${READLINE_ROOT_DIR}/lib -) - -if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND Ncurses_LIBRARY) - set(READLINE_FOUND TRUE) -else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND Ncurses_LIBRARY) - FIND_LIBRARY(READLINE_LIBRARY NAMES readline) - include(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG READLINE_INCLUDE_DIR READLINE_LIBRARY ) - MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY) -endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND Ncurses_LIBRARY) - -mark_as_advanced( - READLINE_ROOT_DIR - READLINE_INCLUDE_DIR - READLINE_LIBRARY -) diff --git a/cmake/Modules/FindSQLite3.cmake b/cmake/Modules/FindSQLite3.cmake deleted file mode 100644 index 910b05cea..000000000 --- a/cmake/Modules/FindSQLite3.cmake +++ /dev/null @@ -1,63 +0,0 @@ -# - Try to find the SQLite3 library -# Once done this will define -# -# SQLITE3_FOUND - System has SQLite3 -# SQLITE3_INCLUDE_DIR - The SQLite3 include directory -# SQLITE3_LIBRARIES - The libraries needed to use SQLite3 -# SQLITE3_DEFINITIONS - Compiler switches required for using SQLite3 -# SQLITE3_EXECUTABLE - The SQLite3 command line shell -# SQLITE3_VERSION_STRING - the version of SQLite3 found (since CMake 2.8.8) - -#============================================================================= -# Copyright 2006-2009 Kitware, Inc. -# Copyright 2006 Alexander Neundorf -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -# use pkg-config to get the directories and then use these values -# in the find_path() and find_library() calls -find_package(PkgConfig QUIET) -PKG_CHECK_MODULES(PC_SQLITE QUIET sqlite3) -set(SQLITE3_DEFINITIONS ${PC_SQLITE_CFLAGS_OTHER}) - -find_path(SQLITE3_INCLUDE_DIR NAMES sqlite3.h - HINTS - ${PC_SQLITE_INCLUDEDIR} - ${PC_SQLITE_INCLUDE_DIRS} - ) - -find_library(SQLITE3_LIBRARIES NAMES sqlite3 - HINTS - ${PC_SQLITE_LIBDIR} - ${PC_SQLITE_LIBRARY_DIRS} - ) - -find_program(SQLITE3_EXECUTABLE sqlite3) - -if(PC_SQLITE_VERSION) - set(SQLITE3_VERSION_STRING ${PC_SQLITE_VERSION}) -elseif(SQLITE3_INCLUDE_DIR AND EXISTS "${SQLITE3_INCLUDE_DIR}/sqlite3.h") - file(STRINGS "${SQLITE3_INCLUDE_DIR}/sqlite3.h" sqlite3_version_str - REGEX "^#define[\t ]+SQLITE_VERSION[\t ]+\".*\"") - - string(REGEX REPLACE "^#define[\t ]+SQLITE_VERSION[\t ]+\"([^\"]*)\".*" "\\1" - SQLITE3_VERSION_STRING "${sqlite3_version_str}") - unset(sqlite3_version_str) -endif() - -# 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 - REQUIRED_VARS SQLITE3_LIBRARIES SQLITE3_INCLUDE_DIR - VERSION_VAR SQLITE3_VERSION_STRING) - -mark_as_advanced(SQLITE3_INCLUDE_DIR SQLITE3_LIBRARIES SQLITE3_EXECUTABLE) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 48e665529..6744847e0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -301,32 +301,32 @@ if (HAVE_LIBBSD) target_link_libraries(parser bsd) endif (HAVE_LIBBSD) -if (SQLITE3_FOUND) -include_directories (${SQLITE3_INCLUDE_DIR}) -target_link_libraries(eressea ${SQLITE3_LIBRARIES}) -target_link_libraries(test_eressea ${SQLITE3_LIBRARIES}) +if (SQLite3_FOUND) +target_include_directories (game PRIVATE ${SQLite3_INCLUDE_DIRS}) +target_link_libraries(eressea ${SQLite3_LIBRARIES}) +target_link_libraries(test_eressea ${SQLite3_LIBRARIES}) add_definitions(-DUSE_SQLITE) elseif (DB_FOUND) -include_directories (${DB_INCLUDE_DIR}) +#include_directories (${DB_INCLUDE_DIR}) target_link_libraries(eressea ${DB_LIBRARIES}) target_link_libraries(test_eressea ${DB_LIBRARIES}) add_definitions(-DUSE_DB) -endif(SQLITE3_FOUND) +endif(SQLite3_FOUND) if (READLINE_FOUND) -include_directories (${READLINE_INCLUDE_DIR}) +#include_directories (${READLINE_INCLUDE_DIR}) target_link_libraries(eressea ${READLINE_LIBRARY}) add_definitions(-DUSE_READLINE) endif (READLINE_FOUND) if (CURSES_FOUND) -include_directories (${CURSES_INCLUDE_DIR}) +target_include_directories (eressea ${CURSES_INCLUDE_DIRS}) target_link_libraries(eressea ${CURSES_LIBRARIES}) add_definitions(-DUSE_CURSES) endif(CURSES_FOUND) if (EXPAT_FOUND) -include_directories (${EXPAT_INCLUDE_DIRS}) +target_include_directories (game PRIVATE ${EXPAT_INCLUDE_DIRS}) target_link_libraries(eressea ${EXPAT_LIBRARIES}) target_link_libraries(test_eressea ${EXPAT_LIBRARIES}) endif (EXPAT_FOUND) diff --git a/src/config.pkg.c b/src/config.pkg.c index cc4bb6965..38e1f8785 100644 --- a/src/config.pkg.c +++ b/src/config.pkg.c @@ -2,7 +2,7 @@ ** Lua binding: config */ -#include "tolua.h" +#include #ifndef __cplusplus #include diff --git a/src/eressea.pkg.c b/src/eressea.pkg.c index 289fc323a..9318d975d 100644 --- a/src/eressea.pkg.c +++ b/src/eressea.pkg.c @@ -2,7 +2,7 @@ ** Lua binding: eressea */ -#include "tolua.h" +#include #ifndef __cplusplus #include diff --git a/vs2019-build.bat b/vs2019-build.bat index 299778303..107e6634c 100644 --- a/vs2019-build.bat +++ b/vs2019-build.bat @@ -8,6 +8,8 @@ REM CD .. REM SET ERESSEA=%CD% REM CD %SRCDIR% +SET CMAKE_MODULES="%CMAKE_ROOT%\share\cmake-3.19\Modules;%SRCDIR%\cmake\Modules" + IF exist build-vs%VSVERSION% goto HAVEDIR mkdir build-vs%VSVERSION% :HAVEDIR @@ -15,5 +17,5 @@ cd build-vs%VSVERSION% IF NOT EXIST CMakeCache.txt GOTO NOCACHE DEL CMakeCache.txt :NOCACHE -"%CMAKE_ROOT%\bin\cmake.exe" -A Win32 -G "Visual Studio %VSVERSION%" -DCMAKE_PREFIX_PATH="%LUA_DEV%;%WIN32_DEV%" -DCMAKE_MODULE_PATH="%SRCDIR%/cmake/Modules" -DCMAKE_SUPPRESS_REGENERATION=TRUE .. +"%CMAKE_ROOT%\bin\cmake.exe" -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -A Win32 -G "Visual Studio %VSVERSION%" -DCMAKE_PREFIX_PATH="%LUA_DEV%;%WIN32_DEV%" -DCMAKE_MODULE_PATH="%CMAKE_MODULES%" -DCMAKE_SUPPRESS_REGENERATION=TRUE .. PAUSE