From cf4c0d3ced22555379fdec14d69d6ca35065d8ba Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Fri, 6 Jul 2018 10:53:13 +0200 Subject: [PATCH 1/4] C++17 required --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2827db8..2096a51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,10 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.8) project(KIMA2) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + if(MSVC) add_compile_options(/W4 /WX) else() From c7abfe33d67c31c5ba6e885851d1ee60dca9ea41 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Fri, 6 Jul 2018 10:53:49 +0200 Subject: [PATCH 2/4] subdir added --- src/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1ea1c18..2f3bcac 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1 +1,2 @@ -add_subdirectory("core") \ No newline at end of file +add_subdirectory("core") +add_subdirectory("gui") \ No newline at end of file From 60365877d6a14675adeb1dd9013047f17fad7195 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Fri, 6 Jul 2018 10:54:22 +0200 Subject: [PATCH 3/4] initial commit --- src/gui/CMakeLists.txt | 10 ++++++++++ src/gui/kima2.cpp | 7 +++++++ 2 files changed, 17 insertions(+) create mode 100644 src/gui/CMakeLists.txt create mode 100644 src/gui/kima2.cpp diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt new file mode 100644 index 0000000..bb66887 --- /dev/null +++ b/src/gui/CMakeLists.txt @@ -0,0 +1,10 @@ + +set(GUI_HEADERS + +) +set(GUI_SOURCES + kima2.cpp +) + +add_executable(kima2 ${GUI_SOURCES}) +target_link_libraries(kima2 core) \ No newline at end of file diff --git a/src/gui/kima2.cpp b/src/gui/kima2.cpp new file mode 100644 index 0000000..bc69ee4 --- /dev/null +++ b/src/gui/kima2.cpp @@ -0,0 +1,7 @@ + + +int main() +{ + /* code */ + return 0; +} From 0104e72997e852342daef6ddfc5645b4799d1933 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Fri, 6 Jul 2018 10:54:44 +0200 Subject: [PATCH 4/4] using boost uuid --- src/core/CMakeLists.txt | 6 +++++- src/core/entity.cpp | 5 +++-- src/core/entity.h | 7 ++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 57a7a7a..01edba3 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,4 +1,7 @@ + +find_package(Boost 1.62 REQUIRED) + set(CORE_HEADERS entity.h ) @@ -6,4 +9,5 @@ set(CORE_SOURCES entity.cpp ) -add_library(core STATIC ${CORE_SOURCES}) \ No newline at end of file +add_library(core STATIC ${CORE_SOURCES}) +target_link_libraries(core Boost::boost) \ No newline at end of file diff --git a/src/core/entity.cpp b/src/core/entity.cpp index cb9925d..4c9ece5 100644 --- a/src/core/entity.cpp +++ b/src/core/entity.cpp @@ -1,6 +1,7 @@ #include "entity.h" -Entity::Entity() -{ +#include +Entity::Entity() : uuid(boost::uuids::random_generator()()) +{ } \ No newline at end of file diff --git a/src/core/entity.h b/src/core/entity.h index ab68b40..e7afcbe 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -1,13 +1,18 @@ #ifndef ENTITY_H #define ENTITY_H +#include + +#include + class Entity { public: Entity(); ~Entity(); + const boost::uuids::uuid& getUuid() {return uuid;}; private: - int uuid{-1}; + boost::uuids::uuid uuid; }; #endif //ENTITY_H \ No newline at end of file