Commit f01ad069 authored by sm's avatar sm

Initial commit

parents
core
/build
configure
/nbproject
.metadata
.project
.cproject
.settings
/stuff
stmm-games (0.1) unstable; urgency=low
* Initial release
-- Stefano Marsili <efanomars@gmx.ch> Fri, 30 Nov 2018 18:28:38 +0100
Installation
============
If your Linux distribution has a package manager based on the DEB
package format, like Debian, Ubuntu, Linux Mint and others, you
can create a tar.gz file containing all the DEB binaries and shell
scripts to install and uninstall them. On other distributions you can
directly build and install everything to /usr/local.
Scripts ending with .py usually have many more options than described
here. Use the --help option to list them.
Debian, Ubuntu, Linux Mint and other DEB based systems
------------------------------------------------------
To build the DEBs you need the following packages
$ apt-get install debhelper g++ cmake python3 \
doxygen graphviz \
librsvg2-dev libxml++-2.6-dev
If you haven't done it yet, you also need to build and install the
debian packages:
from source package www.gitlab.com/efanomars/stmm-input/
- libstmm-input-gtk-dev
- libstmm-input-ev-dev
The command to build, from the directory of this file, is
$ ./scripts/debian_create_srcpkg.py --builddir=~/Tmp/builddir
where builddir must be an non existent or empty folder. This builds
a Debian source package and from it the binary packages using Debian
specific tools. In the same builddir it creates the zip
stmm-games-dist.tar.gz containing install and uninstall scripts,
the DEBs binaries and development
packages (API docs included)
Once unzipped in a folder just run the script
$ ./install-bin.sh
which uses 'dpkg -i' to install the DEBs.
The corresponding ./uninstall-bin.sh script is also available.
Other distributions
-------------------
Packages or libraries needed for building:
- libstmm-input-gtk (www.gitlab.com/efanomars/stmm-input/)
- libstmm-input-fake (www.gitlab.com/efanomars/stmm-input/)
- librsvg2-dev (or -devel or similar)
- libxml++-2.6-dev (or -devel or similar)
- g++ and cmake
- doxygen and graphviz
- python3
To directly build and install the libraries to your system use
$ ./scripts/install_stmm-games-all.py -b=Debug --installdir=/usr/local
Compiles (debug mode) and installs all libraries and the executable
to the directory (prefix) '/usr/local'.
The first parameter can also be 'Release', 'MinSizeRel' or 'RelWithDebInfo'
(see cmake documentation).
The second parameter can be omitted ('/usr/local' is the default).
If you want to determine the compiler that the scripts should use,
set the variable CXX first (g++ is the preferred compiler). Ex.:
$ export CXX=g++
If you want to add compiler options, define variable STMM_CPP_OPTIONS.
Ex. (-Wsuggest-override is g++ only):
$ export STMM_CPP_OPTIONS="-Wsuggest-override -Werror"
If you want to define "make" options, set variable STMM_MAKE_OPTIONS.
Ex. (speed up compilation by using at most 2 CPUs):
$ export STMM_MAKE_OPTIONS="--jobs=2"
If you want to install to your home folder (~/usr) instead of system wide
$ ./scripts/install_stmm-games-all.py --installdir /home/myname/usr --no-sudo
and make sure needed bash environment variables are set before the call
$ # for the library loader
$ export LD_LIBRARY_PATH=/home/myname/usr/lib
$ # for pkg-config
$ export PKG_CONFIG_PATH=/home/myname/usr/lib/pkgconfig
$ # for g++ linker
$ export LIBRARY_PATH=/home/myname/usr/lib
$ # to find executable
$ export PATH=/home/myname/usr/bin:$PATH
The installed libraries and are
- libstmm-games
- libstmm-games-fake
- libstmm-games-gtk
- libstmm-games-xml
To uninstall use the same installdir passed to install_stmm-games-all.py.
For example:
$ ./scripts/uninstall_stmm-games-all.py -y --installdir=/usr/local
stmm-games
==========
Game library for C++ (C++14).
This source package contains:
- libstmm-games:
library that defines the base classes of the model and the
interfaces of the view of a game
- libstmm-games-fake:
library meant for developers that need to test their game
based on libstmm-games
- libstmm-games-gtk:
library that implements a view of a game with gtkmm, providing
a Gtk::Window subclass that automatically generates preferences,
highscore dialogs based on parameters passed to it
- libstmm-games-xml:
library that provides an xml game and theme definition language based
on xml and persistency for preferences and highscores
Read the INSTALL file for installation instructions.
Warning
-------
The APIs of the libraries aren't stable yet.
core
/build
configure
/nbproject
.metadata
.project
.cproject
.settings
/stuff
Stefano Marsili, <stemars@gmx.ch>
# File: libstmm-games-fake/CMakeLists.txt
# Copyright © 2019 Stefano Marsili, <stemars@gmx.ch>
#
# 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, either version 3 of the License, or
# (at your option) any later version.
#
# 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, see <http://www.gnu.org/licenses/>
cmake_minimum_required(VERSION 3.0)
project(stmm-games-fake CXX)
set(LIBRARY_OUTPUT_DIRECTORY "build")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../share/cmake)
include(CommonUtil)
CheckBinaryNotSourceTree()
CheckBuildType()
DefineSharedLibOption()
DefineCommonOptions()
DefineCommonCompileOptions()
# Headers dir
set(STMMI_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include")
set(STMMI_HEADERS_DIR "${STMMI_INCLUDE_DIR}/stmm-games-fake")
# Header files
set(STMMI_HEADERS
${STMMI_HEADERS_DIR}/dumbblockevent.h
${STMMI_HEADERS_DIR}/fakelevelview.h
${STMMI_HEADERS_DIR}/fixtureDevices.h
${STMMI_HEADERS_DIR}/fixtureGame.h
${STMMI_HEADERS_DIR}/fixtureGameOwner.h
${STMMI_HEADERS_DIR}/fixtureLayoutAuto.h
${STMMI_HEADERS_DIR}/fixtureStdConfig.h
${STMMI_HEADERS_DIR}/fixtureStdPreferences.h
${STMMI_HEADERS_DIR}/fixtureTestBase.h
${STMMI_HEADERS_DIR}/fixturevariantHighscoresDefinition.h
${STMMI_HEADERS_DIR}/fixturevariantKeyActions.h
${STMMI_HEADERS_DIR}/fixturevariantLayout.h
${STMMI_HEADERS_DIR}/fixturevariantLevelInit.h
${STMMI_HEADERS_DIR}/fixturevariantOptions.h
${STMMI_HEADERS_DIR}/fixturevariantPlayers.h
${STMMI_HEADERS_DIR}/fixturevariantPrefsDevices.h
${STMMI_HEADERS_DIR}/fixturevariantPrefsPlayers.h
${STMMI_HEADERS_DIR}/fixturevariantTeams.h
${STMMI_HEADERS_DIR}/fixturevariantVariables.h
${STMMI_HEADERS_DIR}/mockevent.h
${STMMI_HEADERS_DIR}/stmm-games-fake.h
${STMMI_HEADERS_DIR}/stmm-games-fake-config.h
)
#
# Sources dir
set(STMMI_SOURCES_DIR "${PROJECT_SOURCE_DIR}/src")
# Source files (and headers only used for building)
set(STMMI_SOURCES
${STMMI_SOURCES_DIR}/dumbblockevent.cc
${STMMI_SOURCES_DIR}/fakelevelview.cc
${STMMI_SOURCES_DIR}/mockevent.cc
${STMMI_SOURCES_DIR}/stmm-games-fake.cc
)
# Define library
add_library(stmm-games-fake ${STMMI_SOURCES} ${PROJECT_BINARY_DIR}/stmm-games-fake-config.cc)
include("stmm-games-fake-defs.cmake")
target_include_directories(stmm-games-fake PUBLIC "${STMMGAMESFAKE_EXTRA_INCLUDE_DIRS}")
target_include_directories(stmm-games-fake SYSTEM PUBLIC "${STMMGAMESFAKE_EXTRA_INCLUDE_SDIRS}")
target_include_directories(stmm-games-fake BEFORE PUBLIC
$<BUILD_INTERFACE:${STMMI_HEADERS_DIR}>
$<INSTALL_INTERFACE:include/stmm-games-fake> # <prefix>/include/stmm-games-fake
)
#target_link_libraries(stmm-games-fake stmm-games)
target_link_libraries(stmm-games-fake ${STMMGAMESFAKE_EXTRA_LIBRARIES})
set_target_properties(stmm-games-fake PROPERTIES ${CMAKE_BUILD_TYPE}_POSTFIX "")
set_target_properties(stmm-games-fake PROPERTIES
VERSION ${STMM_GAMES_FAKE_VERSION}
SOVERSION ${STMM_GAMES_FAKE_MAJOR_VERSION}
# OUTPUT_NAME "stmm-games-fake-${STMM_GAMES_FAKE_VERSION}"
)
DefineTargetPublicCompileOptions(stmm-games-fake)
# Set version for stmm-games-fake-config.cc.in
set(STMMI_PKG_VERSION "${STMM_GAMES_FAKE_VERSION}")
# Create config file for library
configure_file("${PROJECT_SOURCE_DIR}/src/stmm-games-fake-config.cc.in"
"${PROJECT_BINARY_DIR}/stmm-games-fake-config.cc" @ONLY)
include(FindPkgConfig)
if (PKG_CONFIG_FOUND)
# Set install dir for pkg-config file
set(STMMI_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
# Create pkg-config file for shared library
configure_file("${PROJECT_SOURCE_DIR}/stmm-games-fake.pc.in"
"${PROJECT_BINARY_DIR}/stmm-games-fake.pc" @ONLY)
endif()
if ($ENV{STMM_CMAKE_COMMENTS})
message(STATUS "")
message(STATUS "stmm-games-fake was configured with the following options:")
message(STATUS " STMMI_HEADERS: ${STMMI_HEADERS}")
message(STATUS " STMMI_SOURCES: ${STMMI_SOURCES}")
message(STATUS " STMMGAMESFAKE_EXTRA_INCLUDE_DIRS: ${STMMGAMESFAKE_EXTRA_INCLUDE_DIRS}")
message(STATUS " STMMGAMESFAKE_EXTRA_INCLUDE_SDIRS: ${STMMGAMESFAKE_EXTRA_INCLUDE_SDIRS}")
message(STATUS " STMMGAMESFAKE_EXTRA_LIBRARIES: ${STMMGAMESFAKE_EXTRA_LIBRARIES}")
message(STATUS " CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
message(STATUS " CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
message(STATUS " CMAKE_CXX_COMPILER_VERSION: ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS " CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
message(STATUS " install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS " BUILD_DOCS: ${BUILD_DOCS}")
message(STATUS " BUILD_TESTING: ${BUILD_TESTING}")
message(STATUS " BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
endif()
# Documentation
add_subdirectory(doc)
if (BUILD_DOCS)
# build automatically, otherwise call `make doc`
add_dependencies(stmm-games-fake doc)
endif()
# Testing
enable_testing()
add_subdirectory(test)
install(TARGETS stmm-games-fake LIBRARY DESTINATION "lib" ARCHIVE DESTINATION "lib")
install(FILES ${STMMI_HEADERS} DESTINATION "include/stmm-games-fake")
if (PKG_CONFIG_FOUND)
install(FILES ${PROJECT_BINARY_DIR}/stmm-games-fake.pc DESTINATION "lib/pkgconfig")
endif()
#====================
# libstmm-games-fake
#====================
Requirements
------------
g++ compiler or compatible (>= C++14)
libstmm-games
Instructions
------------
From this directory execute the following commands:
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=Release ..
Instead of 'Release' CMAKE_BUILD_TYPE can also be set to
'Debug', 'MinSizeRel' or 'RelWithDebInfo'.
To build the documentation add option (before '..')
'-D BUILD_DOCS=ON' to the preceding command.
To build the tests add option
'-D BUILD_TESTING=ON' to the preceding command
To change the default installation directory add definition
'-D CMAKE_INSTALL_PREFIX=/home/adam/mylib' to the preceding command.
$ make
$ sudo make install
sudo might be omitted in the preceding command if installing to a directory
owned by the current user.
$ sudo ldconfig
Alternatively you can just execute the script
$ ./scripts/install_libstmm-games-fake.py -b=Release -t=On -d=On
setting the parameter(s) to your preferred value (like above).
$ ./scripts/install_libstmm-games-fake.py --help
for a description of all available options.
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data