Skip to content

Instantly share code, notes, and snippets.

@sourencho
Created December 17, 2019 14:12
Show Gist options
  • Save sourencho/d7b80cffd625fe65e74434f36ff607b9 to your computer and use it in GitHub Desktop.
Save sourencho/d7b80cffd625fe65e74434f36ff607b9 to your computer and use it in GitHub Desktop.
From 7da6e7ff1d8c4279e2f5896e5096e30fc9b289ac Mon Sep 17 00:00:00 2001
From: souren <souren@papazian.info>
Date: Tue, 17 Dec 2019 18:05:22 +0400
Subject: [PATCH] Fix cxxopts include
---
CMakeLists.txt | 1 +
{src/client/extern => extern}/cxxopts/CMakeLists.txt | 0
{src/client/extern => extern}/cxxopts/include/cxxopts.hpp | 0
src/client/CMakeLists.txt | 4 +---
src/client/main.cpp | 2 +-
src/common/physics/VectorUtil.hpp | 1 +
6 files changed, 4 insertions(+), 4 deletions(-)
rename {src/client/extern => extern}/cxxopts/CMakeLists.txt (100%)
rename {src/client/extern => extern}/cxxopts/include/cxxopts.hpp (100%)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ff62cfd..6d127e5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,4 +16,5 @@ find_package(SFML 2.5 COMPONENTS audio graphics window system REQUIRED)
add_subdirectory(src)
add_subdirectory(extern/catch)
+add_subdirectory(extern/cxxopts)
add_subdirectory(tests)
diff --git a/src/client/extern/cxxopts/CMakeLists.txt b/extern/cxxopts/CMakeLists.txt
similarity index 100%
rename from src/client/extern/cxxopts/CMakeLists.txt
rename to extern/cxxopts/CMakeLists.txt
diff --git a/src/client/extern/cxxopts/include/cxxopts.hpp b/extern/cxxopts/include/cxxopts.hpp
similarity index 100%
rename from src/client/extern/cxxopts/include/cxxopts.hpp
rename to extern/cxxopts/include/cxxopts.hpp
diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt
index 7a6374a..fe38bc0 100644
--- a/src/client/CMakeLists.txt
+++ b/src/client/CMakeLists.txt
@@ -17,6 +17,4 @@ add_library(client-lib
rendering/RenderingController.cpp
)
-add_subdirectory("extern/cxxopts")
-
-target_link_libraries(ug-client PRIVATE client-lib common-lib)
+target_link_libraries(ug-client PRIVATE client-lib common-lib cxxopts)
diff --git a/src/client/main.cpp b/src/client/main.cpp
index fd2422a..646df8d 100644
--- a/src/client/main.cpp
+++ b/src/client/main.cpp
@@ -3,9 +3,9 @@
#include "../common/bots/Bot.hpp"
#include "../common/util/game_def.hpp"
#include "../common/util/game_settings.hpp"
-#include "extern/cxxopts/include/cxxopts.hpp"
#include "systems/ClientGameController.hpp"
#include <SFML/Graphics.hpp>
+#include <cxxopts.hpp>
int main(int argc, char** argv) {
try {
diff --git a/src/common/physics/VectorUtil.hpp b/src/common/physics/VectorUtil.hpp
index db51981..9812547 100644
--- a/src/common/physics/VectorUtil.hpp
+++ b/src/common/physics/VectorUtil.hpp
@@ -2,6 +2,7 @@
#define VectorUtil_hpp
#include <SFML/Graphics.hpp>
+#include <array>
#include <memory>
#include <stdio.h>
--
2.20.1 (Apple Git-117)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment