eg-be / exodbc

exOdbc - open source C++ ODBC library
0 stars 0 forks source link

Remove subversion from Cmake #7

Open eg-be opened 3 years ago

eg-be commented 3 years ago

Checkout is now from git, but if subversion is installed, cmake will try to update the version-info using subversion:

# try to add revision to filename
SET(CPACK_PACKAGE_VERSION_TWEAK 0)
find_package(Subversion)
if(SUBVERSION_FOUND)
  Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
  set (CPACK_PACKAGE_VERSION_TWEAK ${Project_WC_LAST_CHANGED_REV})
  message(STATUS "Updating CPACK_PACKAGE_VERSION_TWEAK to ${CPACK_PACKAGE_VERSION_TWEAK}, read from ${PROJECT_SOURCE_DIR}")
endif()

Obviously, this fails as subversion does not detect a svn-working copy and fails to update the version-tweak.

eg-be commented 3 years ago

can we do the same and add the git-revision?

eg-be commented 3 years ago

https://jonathanhamberg.com/post/cmake-embedding-git-hash