Skip to content

Remove duplicate git version retrieval in CMakeLists.txt#24

Draft
Copilot wants to merge 2 commits intoissue19_conanfrom
copilot/sub-pr-21-another-one
Draft

Remove duplicate git version retrieval in CMakeLists.txt#24
Copilot wants to merge 2 commits intoissue19_conanfrom
copilot/sub-pr-21-another-one

Conversation

Copy link

Copilot AI commented Dec 4, 2025

The CMakeLists.txt contained two identical execute_process blocks retrieving git version info, executing git describe --tag twice unnecessarily.

Changes:

  • Removed duplicate execute_process block (lines 117-132)
  • Consolidated version retrieval into single block that sets both VERSION and IMGSUITE_VERSION macros
  • Preserved error handling with fallback to PROJECT_VERSION

Before:

execute_process(COMMAND git describe --tag ...)
if(${HAVE_GIT_VERSION_INFO} EQUAL 0)
  add_definitions(-DVERSION="${GIT_VERSION_INFO}")
else()
  add_definitions(-DVERSION="${PROJECT_VERSION}")
endif()

include(CTest)

execute_process(COMMAND git describe --tag ...)  # Duplicate
if(${HAVE_GIT_VERSION_INFO} EQUAL 0)
  add_definitions(-DIMGSUITE_VERSION="${GIT_VERSION_INFO}")
endif()

After:

include(CTest)

execute_process(COMMAND git describe --tag ...)
if(${HAVE_GIT_VERSION_INFO} EQUAL 0)
  add_definitions(-DVERSION="${GIT_VERSION_INFO}")
  add_definitions(-DIMGSUITE_VERSION="${GIT_VERSION_INFO}")
else()
  add_definitions(-DVERSION="${PROJECT_VERSION}")
  add_definitions(-DIMGSUITE_VERSION="${PROJECT_VERSION}")
endif()

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: anderskaestner <11174364+anderskaestner@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP to address feedback from review on Issue19 conan PR Remove duplicate git version retrieval in CMakeLists.txt Dec 4, 2025
Copilot AI requested a review from anderskaestner December 4, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants