Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • gamedev/fggl
  • onuralpsezer/fggl
2 results
Show changes
Commits on Source (349)
Showing
with 716 additions and 125 deletions
*,ogg filter=lfs diff=lfs merge=lfs -text
*.mtl filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.obj filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
build/ # build files
cmake-build-debug/ builds/
cmake-build-debug-coverage/ cmake-build-*
imgui.ini imgui.ini
.flatpak-builder/
compile_commands.json
# dotfiles # Engine data
demo/data/*.bin
# dotfiles (IDE)
.idea/ .idea/
.cache/ .cache/
.venv/
# windows visual studio
.vs/
out/
CMakePresets.json
CMakeSettings.json
...@@ -15,72 +15,83 @@ ...@@ -15,72 +15,83 @@
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine:latest image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine:latest
stages: # List of stages for jobs, and their order of execution stages:
- build - build
- test - test
- deploy - deploy
#build-job: # This job runs in the build stage, which runs first. variables:
# stage: build GIT_SUBMODULE_STRATEGY: recursive
# before_script:
# - apk update && apk --update add build-base g++ libstdc++ cmake extra-cmake-modules bash mesa-gl mesa-egl mesa-gles wayland-dev wayland-protocols libxkbcommon-dev
# script:
# - mkdir build && cd build
# - cmake ..
# - make
.f34-ogl: .f34-ogl:
image: git.fossgalaxy.com:8042/gamedev/containers/fedora:34-opengl image: git.fossgalaxy.com:8042/gamedev/containers/fedora:36-opengl
before_script:
- dnf install -y pkgconfig\(dri\) pkgconfig\(glu\) pkgconfig\(x11\) pkgconfig\(xcursor\) pkgconfig\(xi\) pkgconfig\(xinerama\) pkgconfig\(xrandr\) pkgconfig\(lua\) doxygen
- dnf install -y glm-devel glfw-devel openal-soft-devel spdlog-devel freetype-devel yaml-cpp-devel assimp-devel gtest-devel gmock-devel
# Use glfw-wayland from fedora repostory ##
build:f34-repo-wayland: # Build Targets check it builds on popular Linux Distributions
##
build:fedora:
extends: .f34-ogl extends: .f34-ogl
stage: build stage: build
script: script:
- dnf install -y glfw-devel - cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DFGGL_EXT_BULLET=OFF
- mkdir build && cd build - cmake --build build
- cmake ..
- make
artifacts: artifacts:
paths: paths:
- build/fggl/ - build/fggl/
- build/tests/
# use vendored glfw build:ubuntu:
build:f34-fallback-wayland: image: ubuntu:jammy
extends: .f34-ogl
stage: build stage: build
before_script:
- apt update && apt install -y build-essential cmake
- apt install -y libglm-dev libglfw3-dev libopenal-dev libspdlog-dev libfreetype-dev libyaml-cpp-dev libassimp-dev libbullet-extras-dev libgtest-dev libgmock-dev liblua5.2-dev
script: script:
- dnf install -y wayland-devel wayland-protocols-devel libxkbcommon-devel - cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DFGGL_EXT_BULLET=OFF -DFGGL_EXT_LUA=OFF
- mkdir build && cd build - cmake --build build
- cmake ..
- make
# Based on Bruce Cowan's wordsearch package:
flatpak:
image: alpine:latest
stage: deploy
when: manual
only:
- develop
variables:
MANIFEST_PATH: "build-aux/com.fossgalaxy.fggl.demo.yml"
RUNTIME_REPO: "https://flathub.org/repo/flathub.flatpakrepo"
FLATPAK_MODULE: "fggl"
BUNDLE: "fggl-demo.flatpak"
APP_ID: "com.fossgalaxy.fggl.demo"
script:
- apk update && apk add flatpak-builder
- flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- flatpak install -y flathub org.freedesktop.Platform 21.08
- flatpak install -y flathub org.freedesktop.Sdk 21.08
- flatpak-builder _repo ${MANIFEST_PATH}
- flatpak build-bundle _repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID}
artifacts: artifacts:
paths: paths:
- build/fggl/ - ${BUNDLE}
- build/tests/ - _build/meson-logs/meson-log.txt
cache:
paths:
- .flatpak-builder/cache
- .flatpak-builder/downloads
test:f34-fallback-wayland: # Deploy doxygen pages
pages:
extends: .f34-ogl extends: .f34-ogl
stage: test stage: deploy
needs: [ "build:f34-fallback-wayland" ] only:
- develop
script: script:
- cd build && ./tests/testfggl/fggl_test - cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
dependencies: - cmake --build build --target docs
- build:f34-fallback-wayland - cp -r build/docs/html public
artifacts:
#unit-test-job: # This job runs in the test stage. paths:
# stage: test # It only starts when the job in the build stage completes successfully. - public
# before_script:
# - apk update && apk --update add build-base g++ libstdc++ cmake extra-cmake-modules bash mesa-gl wayland-dev wayland-protocols
# script:
# - mkdir build && cd build
# - cmake .. && make # TODO cache build from previous step
# - ./tests/testfggl/fggl_test
#lint-test-job: # This job also runs in the test stage.
# stage: test # It can run at the same time as unit-test-job (in parallel).
# script:
# - echo "Linting code... This will take about 10 seconds."
# - sleep 10
# - echo "No lint issues found."
[submodule "build-aux/shared-modules"]
path = build-aux/shared-modules
url = https://github.com/flathub/shared-modules.git
cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.16)
set(namespace "fggl")
project(FGGL VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(FGGL_WAYLAND True) option(FGGL_EXAMPLES "Should we build examples or just the library" ON)
option(FGGL_TESTS "Should we enable the testing suite?" ON)
option(FGGL_DOCS "Should we build documentation?" ON)
# Set C++ version option(FGGL_EXT_BULLET "Should we build the bullet module?" OFF)
set(CMAKE_CXX_STANDARD 17) option(FGGL_EXT_LUA "Should we build the lua module?" ON)
set(CMAKE_CXX_STANDARD_REQUIRED True)
##
# Windows
# When on windows, integrate vcpkg
##
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
endif()
##
# /windows
##
# Define the project
project(fggl
VERSION 0.1
DESCRIPTION "FOSS Galaxy Game Library, for use in Education, and Games"
HOMEPAGE_URL "https://git.fossgalaxy.com/gamedev/fggl"
LANGUAGES C CXX)
# export compile commands for vim/neovim users
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Doxygen Support # vendor dependencies
# Based on https://vicrucann.github.io/tutorials/quick-cmake-doxygen/ add_subdirectory( vendor/entt )
option(BUILD_DOC "Build Documentation" ON) add_subdirectory( vendor/imgui )
find_package( Doxygen ) add_subdirectory( vendor/glad )
if (DOXYGEN_FOUND)
# Set docs folder # engine headers
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in) file(GLOB_RECURSE public_headers
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) ${PROJECT_SOURCE_DIR}/include/fggl/*.hpp
)
# configure file
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) # engine sources, enable strict compiler warnings
message("Doxygen build started") add_subdirectory( fggl )
target_compile_options( fggl PRIVATE -Wall -Wpedantic -Wextra -Wodr -fno-strict-aliasing -fno-strict-overflow )
# note the option ALL which allows to build the docs together with the application set_property(TARGET fggl PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
add_custom_target( doc_doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} # Unit Tests
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} if (FGGL_TESTS)
COMMENT "Generating API documentation with Doxygen" include(CTest)
VERBATIM ) add_subdirectory(tests)
endif (DOXYGEN_FOUND) endif()
# depedencies # Documentation support
find_package( glfw3 ) if (FGGL_DOCS)
if ( NOT glfw3_FOUND ) find_package(Doxygen)
include(FetchContent) if (Doxygen_FOUND)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) add_subdirectory( docs )
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) else()
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) message(STATUS "Doxygen not found, not building docs")
if ( FGGL_WAYLAND ) endif()
set(GLFW_USE_WAYLAND True) endif()
endif ()
FetchContent_Declare( ##
glfw3 # Optional/Extra modules
URL https://github.com/glfw/glfw/releases/download/3.3.4/glfw-3.3.4.zip ##
)
FetchContent_MakeAvailable( glfw3 ) # 3rd party integrations
endif () if ( FGGL_EXT_BULLET )
add_subdirectory(vendor/imgui/) add_subdirectory( integrations/bullet )
endif()
# engine
add_subdirectory(fggl) if ( FGGL_EXT_LUA )
add_subdirectory( integrations/lua )
# extras endif()
add_subdirectory(tests)
add_subdirectory(demo) # Tools
# add_subdirectory( tools/pack )
# Demo project
if (FGGL_EXAMPLES)
add_subdirectory(demo EXCLUDE_FROM_ALL)
endif()
##
# INSTALL PHASE
# see https://decovar.dev/blog/2021/03/08/cmake-cpp-library/
##
include(GNUInstallDirs)
# Structure preserving header macro
foreach(header ${public_headers})
file(RELATIVE_PATH header_file_path "${CMAKE_CURRENT_SOURCE_DIR}/include" "${header}")
get_filename_component(header_directory_path "${header_file_path}" DIRECTORY)
install(
FILES ${header}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${header_directory_path}"
)
endforeach()
set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "d")
include(CMakePackageConfigHelpers)
set(FGGL_CONFIG_PATH "${CMAKE_INSTALL_LIBDIR}/cmake/fggl")
# generate and install export file
install(EXPORT "${PROJECT_NAME}Targets"
FILE "${PROJECT_NAME}Targets.cmake"
NAMESPACE ${namespace}::
DESTINATION "${FGGL_CONFIG_PATH}"
)
# generate the version file for the config file
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
VERSION "${version}"
COMPATIBILITY AnyNewerVersion
)
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION "${FGGL_CONFIG_PATH}"
)
# install config files
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION "${FGGL_CONFIG_PATH}"
)
# generate the export targets for the build tree
install(TARGETS ${PROJECT_NAME}
EXPORT fgglTargets
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
export(EXPORT "${PROJECT_NAME}Targets"
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake"
NAMESPACE ${namespace}::
)
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(glm)
find_dependency(fmt)
find_dependency(Lua)
find_dependency(spdlog)
find_dependency(Freetype)
find_dependency(OpenAL CONFIG)
find_dependency(OpenGL)
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
check_required_components(@PROJECT_NAME@)
\ No newline at end of file
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://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
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
...@@ -4,14 +4,25 @@ A library for building FOSS Games, Educational Resources and Academic Experiment ...@@ -4,14 +4,25 @@ A library for building FOSS Games, Educational Resources and Academic Experiment
## Development Instructions ## Development Instructions
### Installing dependenecies
FGGL depends on a few dependencies to work correctly.
On Ubuntu:
```bash
sudo apt install build-essential cmake
sudo apt install -y libglm-dev libglfw3-dev libopenal-dev libspdlog-dev libfreetype-dev libyaml-cpp-dev libassimp-dev libbullet-dev
```
On Fedora:
```bash
sudo dnf install -y glm-devel glfw-devel openal-soft-devel spdlog-devel freetype-devel yaml-cpp-devel assimp-devel bullet-devel gcc gcc-c++ cmake gtest-devel doxygen lua lua-devel gmock gmock-devel
```
### Building ### Building
It's designed to be a fairly standard cmake project, so the standard cmake steps should work: It's designed to be a fairly standard cmake project, so the standard cmake steps should work:
```bash ```bash
mkdir build cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cd build cmake --build build
cmake ..
make
``` ```
The library should also build the test scene (`demo`). There is a shellscript in the root of the The library should also build the test scene (`demo`). There is a shellscript in the root of the
...@@ -20,7 +31,34 @@ project that will build the project and run the demo project in gdb. ...@@ -20,7 +31,34 @@ project that will build the project and run the demo project in gdb.
Most of the dependencies should be downloaded automatically. If you're on X don't use glfw from the Most of the dependencies should be downloaded automatically. If you're on X don't use glfw from the
Fedora repos, it won't work (it's configured for Wayland). The version the project builds should work. Fedora repos, it won't work (it's configured for Wayland). The version the project builds should work.
### Useful Tools ### Deploying
The library is designed to be used as a shared library, as it is licenced in the LGPL. You can generate the shared library, header files and assoicated cmake files using the following command:
```bash
cmake --install build --prefix /tmp/fggl-lib
```
This will place the files in /tmp/fggl-lib, you can adjust this to suit your needs.
You can then include the library in your application using cmake, eg:
```bash
find_package(spdlog REQUIRED)
target_link_libraries(game spdlog::spdlog)
find_package( fggl REQUIRED PATHS /tmp/fggl-lib )
target_link_libraries(game fggl::fggl)
```
### Flatpak Demo
This is still experimental, but the command used to test flatpak compatablity with the demo application is:
```
flatpak-builder builds/flatpak build-aux/com.fossgalaxy.fggl.demo.yml --force-clean --install --user
```
## Useful Tools
The following tools are helpful for development: The following tools are helpful for development:
* Valgrind (see the ways in which memory is messed up) * Valgrind (see the ways in which memory is messed up)
......
app-id: com.fossgalaxy.fggl.Demo
runtime: org.freedesktop.Platform
runtime-version: '21.08'
sdk: org.freedesktop.Sdk
command: /app/bin/demo
finish-args:
- "--device=dri"
- "--share=ipc"
- "--socket=fallback-x11"
- "--socket=wayland"
modules:
- modules/glfw.yml
- modules/glm-0.9.9.8.json
- modules/fmt.yml
- modules/spdlog.json
- modules/googletest.yml
- shared-modules/glu/glu-9.json
- modules/yaml-cpp.yml
- modules/assimp.yml
- name: fggl
buildsystem: cmake
builddir: true
sources:
- type: dir
path: ../
cleanup:
- '/include'
- '/cmake'
- '*.a'
Name: fggl
Version: 0.1.0
Release: 1%{?dist}
Summary: FOSS Galaxy game library
License: LGPLv3
# The source was pulled from github
source0: https://git.fossgalaxy.com/gamedev/fggl/-/archive/develop/fggl-develop.zip
BuildRequires: g++
BuildRequires: cmake
BuildRequires: glfw-devel
BuildRequires: openal-devel
BuildRequires: glm-devel
BuildRequires: glfw-devel
BuildRequires: openal-soft-devel
BuildRequires: spdlog-devel
BuildRequires: freetype-devel
BuildRequires: yaml-cpp-devel
BuildRequires: assimp-devel
BuildRequires: bullet-devel
BuildRequires: gtest-devel
BuildRequires: gmock-devel
# demo desktop stuff
BuildRequires: libappstream-glib
BuildRequires: desktop-file-utils
%description
%{summary}.
%prep
%setup -q -n %{name}-develop
%build
%cmake
%cmake_build
%install
%cmake_install
%check
%ctest
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml
desktop-file-validate %{buildroot}/%{_datadir}/applications/com.fossgalaxy.fggl.Demo.desktop
%package demos
Summary: Demos for fggl
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
%description demos
FGGL example binaries
%package devel
Summary: FGGL development libraries and header files
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
fggl dynamic libraries and header files.
%files
%{_libdir}/libfggl.so
%files devel
%{_includedir}/fggl/*
%{_libdir}/cmake/%{name}
# this feels like a packaging bug...
%{_libdir}/libimgui.a
%files demos
%{_bindir}/demo
%{_datadir}/fggl-demo/*
%{_datadir}/applications/com.fossgalaxy.fggl.Demo.desktop
%{_metainfodir}/com.fossgalaxy.fggl.Demo.metainfo.xml
name: assimp
buildsystem: cmake
config-opts:
- -DASSIMP_BUILD_ASSIMP_TOOLS=OFF
- -DASSIMP_BUILD_TESTS=OFF
sources:
- type: git
url: https://github.com/assimp/assimp.git
tag: v5.2.4
cleanup:
- '/include'
- '/lib/cmake'
- '/lib/pkgconfig'
name: fmt
buildsystem: cmake
sources:
- type: git
url: https://github.com/fmtlib/fmt.git
tag: 8.1.1
cleanup:
- '/include'
- '/lib/cmake'
- '/lib/pkgconfig'
- '*.a'
name: glfw
buildsystem: cmake-ninja
builddir: true
sources:
- type: archive
url: https://github.com/glfw/glfw/releases/download/3.3.4/glfw-3.3.4.zip
sha256: bbd2c42c660b725e9755eb417e40b373f0d4c03138c9b2e210d02cd308bd99cd
cleanup:
- /include
- /lib/cmake
- /lib/pkgconfig
- '*.a'
{
"name": "glm",
"buildsystem": "simple",
"build-commands": [
"mkdir -p /app/include/",
"cp -vr glm /app/include/",
"rm -v /app/include/glm/CMakeLists.txt",
"mkdir -p /app/lib/",
"cp -vr cmake /app/lib/"
],
"sources": [
{
"type": "git",
"url": "https://github.com/g-truc/glm.git",
"tag": "0.9.9.8"
}
],
"cleanup": [
"/include",
"/lib/cmake"
]
}
name: googletest
buildsystem: cmake
sources:
- type: archive
url: https://github.com/google/googletest/archive/refs/tags/release-1.11.0.zip
sha256: 353571c2440176ded91c2de6d6cd88ddd41401d14692ec1f99e35d013feda55a
cleanup:
- '/include'
- '/lib/cmake'
- '/lib/pkgconfig'
- '*.a'
{
"name": "spdlog",
"buildsystem": "cmake",
"sources": [
{
"type": "git",
"url": "https://github.com/gabime/spdlog.git",
"tag": "v1.10.0"
}
],
"cleanup": [
"/include",
"/lib/cmake",
"/lib/pkgconfig",
"*.a"
]
}
name: yaml-cpp
buildsystem: cmake
config-opts:
- -DYAML_CPP_BUILD_TESTS=off
sources:
- type: git
url: https://github.com/jbeder/yaml-cpp.git
tag: yaml-cpp-0.7.0
cleanup:
- '/include'
- '/share/cmake'
- '/share/pkgconfig'
- '*.a'
Subproject commit 1bb53934f105743f84f923693847185dce613cef
...@@ -2,13 +2,11 @@ ...@@ -2,13 +2,11 @@
CACHE=/tmp/fggl/ CACHE=/tmp/fggl/
LOG=$CACHE/demo.log LOG=$CACHE/demo.log
EXE="../build/demo/FgglDemo"
if [[ ! -d "build/" ]] BUILD_PATH="builds/cli"
then DEMO_EXE="$PWD/$BUILD_PATH/demo/demo"
mkdir build
fi
# check cmake exists
if [ ! -x "$(command -v cmake)" ]; then if [ ! -x "$(command -v cmake)" ]; then
sudo dnf install -y cmake extra-cmake-modules sudo dnf install -y cmake extra-cmake-modules
sudo dnf install -y wayland-devel libxkbcommon-devel wayland-protocols-devel sudo dnf install -y wayland-devel libxkbcommon-devel wayland-protocols-devel
...@@ -16,30 +14,32 @@ if [ ! -x "$(command -v cmake)" ]; then ...@@ -16,30 +14,32 @@ if [ ! -x "$(command -v cmake)" ]; then
fi fi
# if doing shader development, disable the cache to make sure changes take affect # if doing shader development, disable the cache to make sure changes take affect
rm -rf builds/cli
rm -rf $CACHE rm -rf $CACHE
# #
# build step # build step
# #
pushd build cmake -S . -B $BUILD_PATH -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake .. cmake --build $BUILD_PATH
make cmake --install $BUILD_PATH --prefix /tmp/fggl-lib
popd
# #
# additional stuff # additional stuff
# #
#EXE="gdb $EXE"
# gamemoderun # gamemoderun
if [ -x "$(command -v gamemoderun)" ]; then if [ -x "$(command -v gamemoderun)" ]; then
EXE="gamemoderun $EXE" DEMO_EXE="gamemoderun $DEMO_EXE"
fi fi
# mangohud # mangohud
if [ -x "$(command -v mangohud)" ]; then if [ -x "$(command -v mangohud)" ]; then
EXE="mangohud --dlsym $EXE" DEMO_EXE="mangohud --dlsym $DEMO_EXE"
fi fi
pushd demo pushd demo
$EXE ../build/demo/FgglDemo $DEMO_EXE
popd popd
cmake_minimum_required(VERSION 3.16)
project(demo)
# Executable # Executable
add_executable(FgglDemo main.cpp) add_executable(demo
target_link_libraries(FgglDemo fggl) demo/main.cpp
target_include_directories(FgglDemo PUBLIC ${PROJECT_BINARY_DIR}) demo/GameScene.cpp
demo/rollball.cpp
demo/topdown.cpp
demo/grid.cpp
demo/robot/programmer.cpp
demo/models/viewer.cpp
demo/hexboard/board.cpp
demo/hexboard/camera.cpp
)
# set build flags
target_compile_options( demo PRIVATE -Wall -Wextra -Wodr -Wdouble-promotion -fno-strict-aliasing -fno-strict-overflow )
set_property(TARGET demo PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
target_include_directories(demo
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
)
target_link_libraries( demo fggl )
#target_link_libraries(demo fggl fgglbt)
if ( FGGL_EXT_LUA )
target_link_libraries( demo fggl-lua )
endif()
# rssources find_package(spdlog)
target_link_libraries(demo spdlog::spdlog)
#target_include_directories(FgglDemo PUBLIC ${PROJECT_BINARY_DIR})
#find_package(Lua)
#target_link_libraries(demo ${LUA_LIBRARIES})
# resources
file(GLOB_RECURSE data data/*) file(GLOB_RECURSE data data/*)
file(COPY ${data} DESTINATION data ) file(COPY ${data} DESTINATION data )
\ No newline at end of file
include(GNUInstallDirs)
install(
TARGETS demo
RUNTIME
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
DIRECTORY data/
DESTINATION ${CMAKE_INSTALL_DATADIR}/fggl-demo
)
# Linux Desktop Entries
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(FILES aux/com.fossgalaxy.fggl.Demo.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications )
install(FILES aux/com.fossgalaxy.fggl.Demo.metainfo.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo )
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")