Skip to content

[WIP] Fedora dev dependencies #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ target_include_directories(
PUBLIC
include
${OPENGL_INCLUDE_DIRS}
bundle/vcpkg/installed/x64-linux/include/
)

target_link_libraries(
Expand Down
50 changes: 50 additions & 0 deletions INSTALL.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
all: info

.PHONY: info
info:
@echo "Install packages for OS. See file for the details."

glm_fed30=http://download-ib01.fedoraproject.org/pub/fedora/linux/releases/30/Everything/x86_64/os/Packages/g/glm-devel-0.9.9.2-2.fc30.noarch.rpm
.PHONY: fedora
fedora:
sudo xargs -P1 -a packages.fedora dnf install -y
wget $(glm_fed30)
sudo dnf --refresh install glm-devel-0.9.9.2-2.fc30.noarch.rpm

BUNDLE_DIR=bundle/
VCPKG_DIR=$(BUNDLE_DIR)/vcpkg
VCPKG=$(VCPKG_DIR)/vcpkg

$(VCPKG):
-git clone https://github.com/Microsoft/vcpkg.git $(VCPKG_DIR)
cd $(VCPKG_DIR) && ./bootstrap-vcpkg.sh
cd $(VCPKG_DIR) && ./vcpkg integrate install

.PHONY: assimp
assimp: $(VCPKG)
$(VCPKG) install assimp

.PHONY: SDL2
SDL2: $(VCPKG)
$(VCPKG) install SDL2


BUILD_DIR=cmake-build-debug-ccache
.PHONY: build
build: | SDL2 assimp
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/local/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/bin/g++ -DCMAKE_TOOLCHAIN_FILE=bundle/vcpkg/scripts/buildsystems/vcpkg.cmake -G "CodeBlocks - Unix Makefiles"
cmake --build $(BUILD_DIR) --target ClearColorSample -j 4
cmake --build $(BUILD_DIR) -j 4

.PHONY: run
run:
./$(BUILD_DIR)/examples/1-clear-color/ClearColorSample

IMAGE=blue-build
.PHONY: build-docker-image
build-docker-image:
cd docker && sudo docker build . -t $(IMAGE)

.PHONY: build-docker
build-docker:
sudo docker run -it --rm -v $(PWD):/project $(IMAGE) make -f INSTALL.mk build BUILD_DIR=cmake-build-docker
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Examples cover:
| SDL2 | 2.0.9 | Abstraction for creating window and obtaining OpenGL context. | ZLIB
| glm | 0.9.9.5 | Linear algebra. | The Happy Bunny License (Modified MIT License)
| GTest | 1.8.1 | Running unit tests. | BSD 3-clause
| Assimp | 2.8 | Loading 3D models. | BSD 3-clause
| Assimp | 4.0 | Loading 3D models. | BSD 3-clause
| glad | 2.0.0 | Providing OpenGL headers, specific OpenGL version enforcement. **Note: Bundled in sources.** | MIT
| imgui | 1.70 | Rendering GUI in current OpenGL context. **Note: Bundled in sources.** | MIT
| stbimage | 2.0 | Decoding images to RGBA space. **Note: Bundled in sources.** | Public domain
Expand Down
2 changes: 1 addition & 1 deletion cmake/dependencies/Linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function(blue_find_dependencies_linux)
find_package(glm REQUIRED)
find_package(SDL2 REQUIRED)
find_package(spdlog REQUIRED)
find_package(Assimp REQUIRED)


target_link_libraries(Dependencies INTERFACE
SDL2::SDL2-static
Expand Down
8 changes: 8 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM fedora:30

# assuming local directory is mounted at /project

RUN dnf install make -y
RUN mkdir /project
COPY INSTALL.mk /project/Makefile
RUN cd /project && make fedora && make SDL2 assimp
9 changes: 9 additions & 0 deletions packages.fedora
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
assimp-devel
glm-devel
gtest
SDL2
SDL2-devel
SDL2_image-devel
SDL2_gfx-devel
SDL2-static
spdlog-devel
5 changes: 5 additions & 0 deletions src/blue/ResourcesPath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
#include "blue/ResourcesPath.h"
#include <string>
#include <assert.h>

#ifdef _WIN32
#include <SDL.h>
#else
#include <SDL2/SDL.h>
#endif

namespace {
const char *CURRENT_PLATFORM = BLUE_PLATFORM;
Expand Down