diff --git a/CMakeLists.txt b/CMakeLists.txt index 38fd437..bd4f875 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,6 +110,7 @@ target_include_directories( PUBLIC include ${OPENGL_INCLUDE_DIRS} + bundle/vcpkg/installed/x64-linux/include/ ) target_link_libraries( diff --git a/INSTALL.mk b/INSTALL.mk new file mode 100644 index 0000000..aeee49b --- /dev/null +++ b/INSTALL.mk @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index a2925f9..f5ee1f2 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/cmake/dependencies/Linux.cmake b/cmake/dependencies/Linux.cmake index 28cf5a2..17a25c3 100644 --- a/cmake/dependencies/Linux.cmake +++ b/cmake/dependencies/Linux.cmake @@ -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 diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..0c3d8bc --- /dev/null +++ b/docker/Dockerfile @@ -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 diff --git a/packages.fedora b/packages.fedora new file mode 100644 index 0000000..3d7ac51 --- /dev/null +++ b/packages.fedora @@ -0,0 +1,9 @@ +assimp-devel +glm-devel +gtest +SDL2 +SDL2-devel +SDL2_image-devel +SDL2_gfx-devel +SDL2-static +spdlog-devel diff --git a/src/blue/ResourcesPath.cpp b/src/blue/ResourcesPath.cpp index bdcf1f4..659f5ad 100644 --- a/src/blue/ResourcesPath.cpp +++ b/src/blue/ResourcesPath.cpp @@ -5,7 +5,12 @@ #include "blue/ResourcesPath.h" #include #include + +#ifdef _WIN32 #include +#else +#include +#endif namespace { const char *CURRENT_PLATFORM = BLUE_PLATFORM;