mirror of
https://github.com/minetest/minetestmapper.git
synced 2024-12-04 13:23:47 +01:00
parent
f26070ef4f
commit
8b563f409e
10
.gitignore
vendored
10
.gitignore
vendored
@ -1,10 +1,14 @@
|
|||||||
colors.txt
|
*~
|
||||||
|
|
||||||
minetestmapper
|
minetestmapper
|
||||||
minetestmapper.exe
|
minetestmapper.exe
|
||||||
|
colors.txt
|
||||||
|
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
CMakeFiles/
|
CMakeFiles/
|
||||||
CPack*
|
CPack*.cmake
|
||||||
|
_CPack_Packages/
|
||||||
|
install_manifest.txt
|
||||||
Makefile
|
Makefile
|
||||||
cmake_install.cmake
|
cmake_install.cmake
|
||||||
cmake_config.h
|
cmake_config.h
|
||||||
*~
|
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
project(minetestmapper CXX)
|
project(minetestmapper
|
||||||
|
VERSION 1.0
|
||||||
set(VERSION_MAJOR 1)
|
LANGUAGES CXX
|
||||||
set(VERSION_MINOR 0)
|
)
|
||||||
set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}")
|
|
||||||
|
|
||||||
# Stuff & Paths
|
# Stuff & Paths
|
||||||
|
|
||||||
@ -13,18 +12,17 @@ if(NOT CMAKE_BUILD_TYPE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -DNDEBUG")
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g2 -Wall")
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(SHAREDIR ".")
|
set(SHAREDIR ".")
|
||||||
set(BINDIR ".")
|
set(BINDIR ".")
|
||||||
set(DOCDIR ".")
|
set(DOCDIR ".")
|
||||||
else()
|
else()
|
||||||
set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/minetest") # reuse Minetest share dir
|
set(SHAREDIR "share/minetest") # reuse Minetest share dir
|
||||||
set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
set(BINDIR "bin")
|
||||||
set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}")
|
set(DOCDIR "share/doc/${PROJECT_NAME}")
|
||||||
set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
|
set(MANDIR "share/man")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CUSTOM_SHAREDIR "" CACHE STRING "Directory to install data files into")
|
set(CUSTOM_SHAREDIR "" CACHE STRING "Directory to install data files into")
|
||||||
@ -77,7 +75,17 @@ option(ENABLE_POSTGRESQL "Enable PostgreSQL backend" TRUE)
|
|||||||
set(USE_POSTGRESQL FALSE)
|
set(USE_POSTGRESQL FALSE)
|
||||||
|
|
||||||
if(ENABLE_POSTGRESQL)
|
if(ENABLE_POSTGRESQL)
|
||||||
find_package("PostgreSQL")
|
if(CMAKE_VERSION VERSION_LESS "3.20")
|
||||||
|
find_package(PostgreSQL QUIET)
|
||||||
|
# Before CMake 3.20 FindPostgreSQL.cmake always looked for server includes
|
||||||
|
# but we don't need them, so continue anyway if only those are missing.
|
||||||
|
if(PostgreSQL_INCLUDE_DIR AND PostgreSQL_LIBRARY)
|
||||||
|
set(PostgreSQL_FOUND TRUE)
|
||||||
|
set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
find_package(PostgreSQL)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(PostgreSQL_FOUND)
|
if(PostgreSQL_FOUND)
|
||||||
set(USE_POSTGRESQL TRUE)
|
set(USE_POSTGRESQL TRUE)
|
||||||
@ -148,7 +156,16 @@ configure_file(
|
|||||||
)
|
)
|
||||||
add_definitions(-DUSE_CMAKE_CONFIG_H)
|
add_definitions(-DUSE_CMAKE_CONFIG_H)
|
||||||
|
|
||||||
set(mapper_SRCS
|
if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g2")
|
||||||
|
add_compile_options(-Wall -pipe)
|
||||||
|
endif()
|
||||||
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||||
|
add_definitions(-DNDEBUG)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_executable(minetestmapper
|
||||||
BlockDecoder.cpp
|
BlockDecoder.cpp
|
||||||
PixelAttributes.cpp
|
PixelAttributes.cpp
|
||||||
PlayerAttributes.cpp
|
PlayerAttributes.cpp
|
||||||
@ -158,22 +175,9 @@ set(mapper_SRCS
|
|||||||
mapper.cpp
|
mapper.cpp
|
||||||
util.cpp
|
util.cpp
|
||||||
db-sqlite3.cpp
|
db-sqlite3.cpp
|
||||||
)
|
$<$<BOOL:${USE_POSTGRESQL}>:db-postgresql.cpp>
|
||||||
|
$<$<BOOL:${USE_LEVELDB}>:db-leveldb.cpp>
|
||||||
if(USE_POSTGRESQL)
|
$<$<BOOL:${USE_REDIS}>:db-redis.cpp>
|
||||||
set(mapper_SRCS ${mapper_SRCS} db-postgresql.cpp)
|
|
||||||
endif(USE_POSTGRESQL)
|
|
||||||
|
|
||||||
if(USE_LEVELDB)
|
|
||||||
set(mapper_SRCS ${mapper_SRCS} db-leveldb.cpp)
|
|
||||||
endif(USE_LEVELDB)
|
|
||||||
|
|
||||||
if(USE_REDIS)
|
|
||||||
set(mapper_SRCS ${mapper_SRCS} db-redis.cpp)
|
|
||||||
endif(USE_REDIS)
|
|
||||||
|
|
||||||
add_executable(minetestmapper
|
|
||||||
${mapper_SRCS}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
@ -198,16 +202,14 @@ if(UNIX)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Overview mapper for Minetest")
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Overview mapper for Minetest")
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
|
|
||||||
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
|
|
||||||
set(CPACK_PACKAGE_VENDOR "celeron55")
|
set(CPACK_PACKAGE_VENDOR "celeron55")
|
||||||
set(CPACK_PACKAGE_CONTACT "Perttu Ahola <celeron55@gmail.com>")
|
set(CPACK_PACKAGE_CONTACT "Perttu Ahola <celeron55@gmail.com>")
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win32")
|
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-win32")
|
||||||
set(CPACK_GENERATOR ZIP)
|
set(CPACK_GENERATOR ZIP)
|
||||||
else()
|
else()
|
||||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-linux")
|
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-linux")
|
||||||
set(CPACK_GENERATOR TGZ)
|
set(CPACK_GENERATOR TGZ)
|
||||||
set(CPACK_SOURCE_GENERATOR TGZ)
|
set(CPACK_SOURCE_GENERATOR TGZ)
|
||||||
endif()
|
endif()
|
||||||
|
17
README.rst
17
README.rst
@ -18,21 +18,22 @@ Requirements
|
|||||||
* hiredis (optional)
|
* hiredis (optional)
|
||||||
* Postgres libraries (optional)
|
* Postgres libraries (optional)
|
||||||
|
|
||||||
on Debian:
|
on Debian/Ubuntu:
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
sudo apt install libgd-dev libsqlite3-dev libleveldb-dev libhiredis-dev libpq-dev
|
``sudo apt install libgd-dev libsqlite3-dev libleveldb-dev libhiredis-dev libpq-dev``
|
||||||
|
|
||||||
on openSUSE:
|
on openSUSE:
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
sudo zypper install gd-devel sqlite3-devel leveldb-devel hiredis-devel postgresql-devel postgresql-server-devel
|
``sudo zypper install gd-devel sqlite3-devel leveldb-devel hiredis-devel postgresql-devel``
|
||||||
|
|
||||||
Windows
|
for Windows:
|
||||||
^^^^^^^
|
^^^^^^^^^^^^
|
||||||
Minetestmapper for Windows can be downloaded here: https://github.com/minetest/minetestmapper/releases
|
Minetestmapper for Windows can be downloaded `from the Releases section
|
||||||
|
<https://github.com/minetest/minetestmapper/releases>`_.
|
||||||
|
|
||||||
After extracting the archive, minetestmapper can be invoked from cmd.exe:
|
After extracting the archive, it can be invoked from cmd.exe:
|
||||||
::
|
::
|
||||||
|
|
||||||
cd C:\Users\yourname\Desktop\example\path
|
cd C:\Users\yourname\Desktop\example\path
|
||||||
|
Loading…
Reference in New Issue
Block a user