Skip to content
Snippets Groups Projects
Commit aa4970f4 authored by Mathias Paulin's avatar Mathias Paulin :speech_balloon:
Browse files

[librender] Add stduuid dependency as submodule

parent 07249d9e
Branches
No related tags found
No related merge requests found
[submodule "stduuid"]
path = src/libRender/Dependencies/stduuid
url = git@github.com:MathiasPaulin/stduuid.git
......@@ -178,6 +178,14 @@ set(resources
Resources/RadiumNBR/RenderGraphs/fullfeaturerenderer.flow
)
# std::uuid dependency
# Note, follow the progress of integration of uuid generator in the C++ std lib. When supported by std, remove this dependency
set(UUID_BUILD_TESTS OFF)
set(UUID_SYSTEM_GENERATOR ON)
set(UUID_USING_CXX20_SPAN OFF) # change this when going to C++20 as language standard for Radium libs
add_subdirectory(Dependencies/stduuid)
# TODO verify correct installation and usage in Config.cmake.in
# Our library project uses these sources and headers.
add_library(
......@@ -200,6 +208,7 @@ target_link_libraries(
PUBLIC
Radium::Core
Radium::Engine
stduuid
)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
......
......@@ -28,6 +28,7 @@ if ( NOT Radium_FOUND)
endif()
if (NBR_FOUND)
# TODO : search for installed stduuid
include("${CMAKE_CURRENT_LIST_DIR}/NBRTargets.cmake" )
radium_exported_resources(
TARGET RadiumNBR::NBR
......
Subproject commit 5c538cca02932aa0266659661d5b4726f3a317c7
......@@ -15,7 +15,8 @@ void Node::fromJson( const nlohmann::json& data ) {
#endif
// get the common content of the Node from the json data
m_uuid = data["id"];
std::string struuid = data["id"];
m_uuid = uuids::uuid::from_string(struuid).value();
std::string readTypeName = data["model"]["name"];
if ( readTypeName != m_typeName )
{
......@@ -37,7 +38,8 @@ void Node::fromJson( const nlohmann::json& data ) {
void Node::toJson( nlohmann::json& data ) const {
// write the common content of the Node to the json data
data["id"] = m_uuid;
std::string struuid = "{" + uuids::to_string(m_uuid) + "}";
data["id"] = struuid;
nlohmann::json model;
model["instance"] = m_instanceName;
......
......@@ -5,6 +5,8 @@
#include <RadiumNBR/externals/json.hpp>
#include <uuid.h>
#include <cstdint>
#include <iostream>
#include <memory>
......@@ -194,7 +196,8 @@ class NodeBasedRenderer_LIBRARY_API Node
/// The uuid of the node (TODO, use https://github.com/mariusbancila/stduuid instead of a
/// string)
std::string m_uuid;
//std::string m_uuid;
uuids::uuid m_uuid;
/// The type name of the node
std::string m_typeName;
/// The instance name of the node
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment