Permalink
Browse files

Get the ci working with precompiled vcpkg binaries

  • Loading branch information...
MattRyder committed Jul 23, 2018
1 parent 07fd2da commit 17c1386dea197e9dd4845188e5f3ad205198af2a
@@ -19,6 +19,6 @@ install:
script:
- mkdir build
- cd build
- cmake .. -DBUILD_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=/home/travis/vcpkg/scripts/buildsystems/vcpkg.cmake
- cmake .. -DBUILD_TESTS=ON -DBUILD_EDITOR=OFF -DCMAKE_TOOLCHAIN_FILE=/home/travis/vcpkg/scripts/buildsystems/vcpkg.cmake
- make
- ./Tests/GibTest
@@ -12,6 +12,4 @@ newmtl 01___Default
Kd 0.5880 0.5880 0.5880
Ks 0.0720 0.0720 0.0720
Ke 0.0000 0.0000 0.0000
map_Kd diffuse.png
map_Bump normal.png
map_Ks specular.png
map_Kd diffuse.png
@@ -12,10 +12,10 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/include")

add_subdirectory(Engine/)

#if(BUILD_EDITOR)
# add_subdirectory(Editor/)
#endif()
if(BUILD_EDITOR)
add_subdirectory(Editor/)
endif()

#if(BUILD_TESTS)
if(BUILD_TESTS)
add_subdirectory(Tests/)
#endif()
endif()
@@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 2.6)
project(Editor CXX)

list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

if(UNIX)
find_package(GTK3 REQUIRED)
if(GTK3_FOUND)
@@ -88,5 +86,12 @@ source_group("Shaders\\GL420" FILES ${GL420_SHADER_FILES})
source_group("Components" FILES ${COMPONENT_FILES})

target_link_libraries(GibEditor GibEngine ${GTK3_LIBRARIES})
if(WIN32)
target_link_libraries(GibEditor opengl32)
endif(WIN32)

add_dependencies(GibEditor GibEngine)

add_dependencies(GibEditor GibEngine)
add_custom_command(TARGET GibEditor PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/Assets $<TARGET_FILE_DIR:GibEditor>/Assets)
@@ -4,4 +4,4 @@

#include <imgui_impl_glfw_gl3.h>

void SetupImGuiStyle();
void SetupImGuiStyle(const std::string& currentWorkingDirectory);
@@ -1,12 +1,13 @@
#include "Main.h"

int main(int argc, char** argv)
{
GibEditor::Editor* editor = new GibEditor::Editor(argc, argv);
{
auto editor = std::make_unique<GibEditor::Editor>(argc, argv);
auto cwd = editor->GetFileSystem()->GetWorkingDirectory();

auto imguiCtx = ImGui::CreateContext();
ImGui_ImplGlfwGL3_Init(editor->GetWindow(), false);
SetupImGuiStyle();
SetupImGuiStyle(cwd);

GibEditor::Components::Dock::Type lastSelectedDockType = GibEditor::Components::Dock::Type::GAME;

@@ -19,7 +20,6 @@ int main(int argc, char** argv)
ImGui::Render();
ImGui_ImplGlfwGL3_RenderDrawData(ImGui::GetDrawData());


glfwSwapBuffers(editor->GetWindow());

if (editor->GetDock() != nullptr)
@@ -48,15 +48,14 @@ int main(int argc, char** argv)

ImGui_ImplGlfwGL3_Shutdown();
ImGui::DestroyContext(imguiCtx);

delete editor;
}

void SetupImGuiStyle()
void SetupImGuiStyle(const std::string& currentWorkingDirectory)
{
const std::string ttfLocation = currentWorkingDirectory + "\\Assets\\Fonts\\Arimo-Regular.ttf";

ImGuiIO& io = ImGui::GetIO();

io.Fonts->AddFontFromFileTTF("../../Assets/Fonts/Arimo-Regular.ttf", 24.0f);
io.Fonts->AddFontFromFileTTF(ttfLocation.c_str(), 24.0f);

ImGuiStyle& style = ImGui::GetStyle();

@@ -30,11 +30,6 @@ endif()
list(APPEND GIBENGINE_INCLUDE_DIRS ${CXXOPTS_INCLUDE_DIR})

find_package(spdlog CONFIG REQUIRED)
# find_path(SPDLOG_INCLUDE_DIR spdlog/spdlog.h)
# if(SPDLOG_INCLUDE_DIR STREQUAL "SPDLOG_INCLUDE_DIR-NOTFOUND")
# message(FATAL_ERROR "Could not find spdlog")
# endif()
# list(APPEND GIBENGINE_INCLUDE_DIRS ${SPDLOG_INCLUDE_DIR})

find_path(JSON11_INCLUDE_DIR json11.hpp)
if(JSON11_INCLUDE_DIR STREQUAL "JSON11_INCLUDE_DIR-NOTFOUND")
@@ -16,9 +16,9 @@
* All definitions must be terminated with a forward-slash:
*/
#ifdef __unix__
#define ASSET_RELATIVE_PATH "/../Assets/"
#define ASSET_RELATIVE_PATH "/Assets/"
#else
#define ASSET_RELATIVE_PATH "/../../Assets/"
#define ASSET_RELATIVE_PATH "/Assets/"
#endif

#define SCREENSHOT_RELATIVE_PATH "/Screenshots/"
@@ -26,10 +26,11 @@ GibEngine::BaseEntity::BaseEntity(Type type, std::string name)
: BaseEntity(type, name, glm::vec3()) { }

GibEngine::BaseEntity::BaseEntity(Type type, std::string name, glm::vec3 position)
: id(_Id++), type(type), name(name), parent(nullptr), frontVector(-Z_AXIS), upVector(Y_AXIS), activeDirections(Direction::NONE)
: id(_Id++), type(type), name(name), parent(nullptr), frontVector(-Z_AXIS), upVector(Y_AXIS), activeDirections(Direction::NONE),
localTransform(glm::mat4(1.0)), worldTransform(glm::mat4(1.0)), rotationQuaternion()
{
this->nameKey = GetTypeName() + "_" + std::to_string(GetID());
Translate(position);
SetPosition(position);
}

const std::string& GibEngine::BaseEntity::GetTypeName() const
@@ -271,7 +271,7 @@ std::shared_ptr<GibEngine::BaseEntity> GibEngine::Game::CreateWorld()
auto sceneNode = std::make_shared<BaseEntity>(BaseEntity::Type::ENTITY, "Scene Root");

auto skyboxMesh = MeshService::Generate(graphicsApi, MeshService::CUBE_GENERATION_JSON);
auto cubemap = MeshService::LoadCubemap(graphicsApi, fileSystem->GetWorkingDirectory() + "/../../Assets/Skybox/stormy", "png");
auto cubemap = MeshService::LoadCubemap(graphicsApi, fileSystem->GetWorkingDirectory() + "/Assets/Skybox/stormy", "png");
auto skybox = std::shared_ptr<Skybox>(new Skybox(skyboxMesh, cubemap));
skybox->RegisterEvents(eventManager.get());

@@ -282,19 +282,19 @@ std::shared_ptr<GibEngine::BaseEntity> GibEngine::Game::CreateWorld()
1.0f); // 0.0 -- 1.0

// Attach the sphere mesh
auto sphereNode = MeshService::Load(graphicsApi, fileSystem->GetWorkingDirectory() + "/../../Assets/Models/default/sphere/sphere.obj", forwardGenerationData);
auto sphereNode = MeshService::Load(graphicsApi, fileSystem->GetWorkingDirectory() + "/Assets/Models/default/sphere/sphere.obj", forwardGenerationData);
light->AddChild(sphereNode);

// Create a Model node:
auto meshNode = MeshService::Load(graphicsApi, fileSystem->GetWorkingDirectory() + "/../../Assets/Models/brickwall/brickwall.obj", deferredGenerationData);
auto meshNode = MeshService::Load(graphicsApi, fileSystem->GetWorkingDirectory() + "/Assets/Models/brickwall/brickwall.obj", deferredGenerationData);
meshNode->RegisterEvents(eventManager.get());
//auto meshNode = MeshService::Load(graphicsApi, fileSystem->GetWorkingDirectory() + "/../../Assets/Models/sponza/sponza.fbx", deferredGenerationData);
//auto meshNode = MeshService::Load(graphicsApi, fileSystem->GetWorkingDirectory() + "/../../Assets/Models/default/box/box.obj", deferredGenerationData);
meshNode->Translate(glm::vec3(0, 0.5, -10));
//auto meshNode = MeshService::Load(graphicsApi, fileSystem->GetWorkingDirectory() + "/Assets/Models/sponza/sponza.fbx", deferredGenerationData);
//auto meshNode = MeshService::Load(graphicsApi, fileSystem->GetWorkingDirectory() + "/Assets/Models/default/box/box.obj", deferredGenerationData);
meshNode->SetPosition(glm::vec3(0, 0.5, -10));
meshNode->AddChild(playerCamera);

auto floorNode = MeshService::Load(graphicsApi, fileSystem->GetWorkingDirectory() + "/../../Assets/Models/default/box/box.obj", deferredGenerationData);
floorNode->Translate(glm::vec3(-230.0f, 0, -425.0f));
auto floorNode = MeshService::Load(graphicsApi, fileSystem->GetWorkingDirectory() + "/Assets/Models/default/box/box.obj", deferredGenerationData);
floorNode->SetPosition(glm::vec3(-230.0f, 0, -425.0f));
floorNode->Scale(glm::vec3(75.0f, 0.0f, 75.0f));
sceneNode->AddChild(meshNode);

@@ -303,6 +303,8 @@ std::shared_ptr<GibEngine::BaseEntity> GibEngine::Game::CreateWorld()

sceneNode->AddChild(floorNode);

sceneNode->RecalculateWorldTransform();

return sceneNode;
}

@@ -56,7 +56,7 @@ void GibEngine::Renderer::Pipeline::AddPass(RenderPass::Type type)
vertexSource = std::shared_ptr<std::string>(new std::string());
fragmentSource = std::shared_ptr<std::string>(new std::string());

const std::string shaderPath = fileSystem->GetWorkingDirectory() + "/../../Assets/Shaders";
const std::string shaderPath = fileSystem->GetWorkingDirectory() + "/Assets/Shaders";
const std::string vertexRelativePath = shaderPath + std::string("/") + glVersionDirectory + std::string("/") + shaderFileName + std::string("_vs.glsl");
const std::string fragmentRelativePath = shaderPath + std::string("/") + glVersionDirectory + std::string("/") + shaderFileName + std::string("_fs.glsl");
fileSystem->ReadFile(vertexRelativePath, vertexSource);
@@ -12,40 +12,31 @@ platform:
# specify custom environment variables
environment:
MSVC_DEFAULT_OPTIONS: ON
GIBENGINE_VCPKG_EXPORT_URL: http://s3.gibengine.xyz/gibengine-ci/vcpkg
GIBENGINE_VCPKG_NAME: gibengine-vcpkg
GIBENGINE_VCPKG_FILE: gibengine-vcpkg.7z

# build configuration, i.e. Debug, Release, etc.
configuration:
- Debug

# scripts that are called at very beginning, before repo cloning
init:
- cmd: cmake --version
- cmd: msbuild /version


# branches to build
branches:
except:
- gh-pages

# scripts to run before build
before_build:
- cmd: cd c:\tools\vcpkg
- cmd: git pull
- cmd: .\bootstrap-vcpkg.bat
- cmd: git checkout 178517052f42d428bb2f304946e635d3c1f318e9 ports\fmt
- cmd: git checkout 2a0bf9c488d5291e82a37d19d4b0f81e79678f0d ports\spdlog
- cmd: git checkout 809eb64c97e6ec459cd1e1d601e916100395529e ports\cxxopts
- cmd: if "%platform%"=="Win32" set VCPKG_TARGET_TRIPLET=x86-windows
- cmd: if "%platform%"=="x64" set VCPKG_TARGET_TRIPLET=x64-windows
- cmd: vcpkg install glfw3 assimp cxxopts json11 gtest sqlite3 spdlog glm --triplet %VCPKG_TARGET_TRIPLET%
- cmd: vcpkg integrate install
- ps: If ($env:PLATFORM -eq "Win32") { $env:VCPKG_TARGET_TRIPLET="x86-windows" }
- ps: If($env:PLATFORM -eq "x64") { $env:VCPKG_TARGET_TRIPLET="x64-windows" }
- ps: appveyor DownloadFile "$env:GIBENGINE_VCPKG_EXPORT_URL/$env:VCPKG_TARGET_TRIPLET/$env:GIBENGINE_VCPKG_FILE" -FileName "${env:GIBENGINE_VCPKG_FILE}" -Timeout 600000
- ps: 7z x ${env:GIBENGINE_VCPKG_FILE} -oc:\
- cmd: cd c:\projects\gibengine
- cmd: md build
- cmd: cd build
- cmd: if "%platform%"=="Win32" set CMAKE_GENERATOR_NAME=Visual Studio 15 2017
- cmd: if "%platform%"=="x64" set CMAKE_GENERATOR_NAME=Visual Studio 15 2017 Win64
- cmd: cmake -G "%CMAKE_GENERATOR_NAME%" -DVCPKG_TARGET_TRIPLET=%VCPKG_TARGET_TRIPLET% -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=%configuration% -DBUILD_TESTS=ON ..
- cmd: cmake -G "%CMAKE_GENERATOR_NAME%" -DVCPKG_TARGET_TRIPLET=%VCPKG_TARGET_TRIPLET% -DCMAKE_TOOLCHAIN_FILE=c:\%GIBENGINE_VCPKG_NAME%\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=%configuration% -DBUILD_EDITOR=OFF -DBUILD_TESTS=ON ..

build:
project: c:\projects\gibengine\build\GibEngine.sln

0 comments on commit 17c1386

Please sign in to comment.