Skip to content

Commit

Permalink
Merge pull request #49 from skunkforce/dp/version_info
Browse files Browse the repository at this point in the history
added cmake version info and git hash.
  • Loading branch information
Stephanos authored Oct 25, 2023
2 parents 9f75f0b + 6e82236 commit d895316
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_PROJECT_TOP_LEVEL_INCLUDE

set(CMAKE_TOOLCHAIN_FILE "${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake")

project("OmniscopeGui")
project("OmniscopeGui" VERSION 0.5.1)

if(MSVC)
add_compile_options(
Expand All @@ -27,11 +27,18 @@ endif()


include(cmake_helpers/BuildOptions.cmake)
include(cmake_helpers/FindOrFetch.cmake)

add_executable(OmniView src/main.cpp)

target_add_default_build_options(OmniView PUBLIC)

find_or_fetch_package(
cmake_git_version 0.1 GIT_REPOSITORY
https://github.com/dominicpoeschko/cmake_git_version.git GIT_TAG master)

target_add_version_headers(OmniView ${CMAKE_BUILD_TYPE})

add_subdirectory(ImGuiInstance)
target_link_libraries(OmniView PUBLIC imgui_instance::imgui_instance)

Expand Down
14 changes: 12 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <nlohmann/json_fwd.hpp>
#include <set>
#include <thread>
#include <cmake_git_version/version.hpp>
// clang-format off
#include <imfilebrowser.h>
// clang-format on
Expand Down Expand Up @@ -348,6 +349,11 @@ int main() {
captureData.clear();
flagPaused = true;
}

if (ImGui::MenuItem(
fmt::format("Version: {}", CMakeGitVersion::VersionWithGit)
.c_str())) {
}
ImGui::EndMenu();
}
/*
Expand Down Expand Up @@ -676,8 +682,12 @@ int main() {
ImGui::PopStyleColor(7);
};

ImGuiInstance window{1920, 1080, load_json<std::string>(config, "title")};
ImGuiInstance window{1920, 1080,
fmt::format("{} {}",
CMakeGitVersion::Target::Name
, CMakeGitVersion::Project::Version)};

while (window.run(render)) {
}
return 0;
}
}

0 comments on commit d895316

Please sign in to comment.