From 1db40cdcd0711a994ff539974d3af8f601c28ae2 Mon Sep 17 00:00:00 2001 From: mwlasiuk Date: Sun, 11 Jan 2026 22:54:17 +0100 Subject: [PATCH] Fix newline at the end of the Version.hpp + add system independent fPIC in cmake --- apps/manual_color/manual_color.cpp | 2 +- core/CMakeLists.txt | 3 ++- core/src/control_points.cpp | 3 ++- shared/include/HDMapping/Version.hpp | 18 +++++++----------- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/apps/manual_color/manual_color.cpp b/apps/manual_color/manual_color.cpp index 54787eba..4dbd4111 100644 --- a/apps/manual_color/manual_color.cpp +++ b/apps/manual_color/manual_color.cpp @@ -1168,7 +1168,7 @@ void display() } } ImGui::SameLine(); - ImGui::Text("%d: %.1f,%.1f,%.1f", index, p.x(), p.y(), p.z()); + ImGui::Text("%ld: %.1f,%.1f,%.1f", index, p.x(), p.y(), p.z()); } ImGui::EndChild(); diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 9335c4d5..6cc70dc1 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -68,7 +68,8 @@ set(CORE_INCLUDE_FILES_GUI # GUI-independent target add_library(core_no_gui STATIC ${CORE_SOURCE_FILES} ${CORE_INCLUDE_FILES}) target_compile_definitions(core_no_gui PRIVATE WITH_GUI=0) -target_compile_options(core_no_gui PRIVATE -fPIC) +set_target_properties(core_no_gui PROPERTIES + POSITION_INDEPENDENT_CODE ON) target_link_libraries(core_no_gui PRIVATE ${PLATFORM_LASZIP_LIB} ${PLATFORM_MISCELLANEOUS_LIBS}) target_include_directories(core_no_gui PRIVATE include diff --git a/core/src/control_points.cpp b/core/src/control_points.cpp index d81f56a1..0bf39892 100644 --- a/core/src/control_points.cpp +++ b/core/src/control_points.cpp @@ -70,7 +70,8 @@ void ControlPoints::imgui(PointClouds &point_clouds_container, Eigen::Vector3f & int remove_gcp_index = -1; for (int i = 0; i < cps.size(); i++) { - ImGui::Text((std::string("CP_") + std::to_string(i) + " [" + cps[i].name + "]").c_str()); + const auto gui_text = (std::string("CP_") + std::to_string(i) + " [" + cps[i].name + "]"); + ImGui::Text("%s", gui_text.c_str()); ImGui::SameLine(); if (ImGui::Button(("Remove##" + std::to_string(i)).c_str())) { diff --git a/shared/include/HDMapping/Version.hpp b/shared/include/HDMapping/Version.hpp index 29af4225..47c9e0a2 100644 --- a/shared/include/HDMapping/Version.hpp +++ b/shared/include/HDMapping/Version.hpp @@ -1,24 +1,20 @@ #pragma once #ifndef HDMAPPING_VERSION_MAJOR -#error \ - "Major version not defined - define HDMAPPING_VERSION_MAJOR inside top-level CMakeLists.txt file." +#error "Major version not defined - define HDMAPPING_VERSION_MAJOR inside top-level CMakeLists.txt file." #endif #ifndef HDMAPPING_VERSION_MINOR -#error \ - "Minor version not defined - define HDMAPPING_VERSION_MINOR inside top-level CMakeLists.txt file." +#error "Minor version not defined - define HDMAPPING_VERSION_MINOR inside top-level CMakeLists.txt file." #endif #ifndef HDMAPPING_VERSION_PATCH -#error \ - "Minor version not defined - define HDMAPPING_VERSION_PATCH inside top-level CMakeLists.txt file." +#error "Minor version not defined - define HDMAPPING_VERSION_PATCH inside top-level CMakeLists.txt file." #endif #define HDMAPPING_DEFINITION_TO_STRING_X(definition) #definition -#define HDMAPPING_DEFINITION_TO_STRING(definition) \ - HDMAPPING_DEFINITION_TO_STRING_X(definition) +#define HDMAPPING_DEFINITION_TO_STRING(definition) HDMAPPING_DEFINITION_TO_STRING_X(definition) -#define HDMAPPING_VERSION_STRING \ - "v" HDMAPPING_DEFINITION_TO_STRING(HDMAPPING_VERSION_MAJOR) "." HDMAPPING_DEFINITION_TO_STRING( \ - HDMAPPING_VERSION_MINOR) "." HDMAPPING_DEFINITION_TO_STRING(HDMAPPING_VERSION_PATCH) \ No newline at end of file +#define HDMAPPING_VERSION_STRING \ + "v" HDMAPPING_DEFINITION_TO_STRING(HDMAPPING_VERSION_MAJOR) "." HDMAPPING_DEFINITION_TO_STRING( \ + HDMAPPING_VERSION_MINOR) "." HDMAPPING_DEFINITION_TO_STRING(HDMAPPING_VERSION_PATCH)