Skip to content

Commit

Permalink
Merge pull request #9 from eosnetworkfoundation/cmake_option_disablin…
Browse files Browse the repository at this point in the history
…g_version_discovery_git

add cmake option to allow disabling version discovery via git
  • Loading branch information
ClaytonCalabrese authored Jul 12, 2022
2 parents 80763b6 + 7c20c23 commit a1ed1eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ target_include_directories( appbase

set_target_properties( appbase PROPERTIES PUBLIC_HEADER "${HEADERS}" )

option(APPBASE_ENABLE_AUTO_VERSION "enable automatic discovery of version via 'git describe'" ON)

find_package(Git)
if(EXISTS ${CMAKE_SOURCE_DIR}/.git AND GIT_FOUND)
if(APPBASE_ENABLE_AUTO_VERSION AND EXISTS ${CMAKE_SOURCE_DIR}/.git AND GIT_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/version.cmake @ONLY)
add_custom_target(appbase_version ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/version.cmake BYPRODUCTS version.cpp)
add_dependencies(appbase appbase_version)
Expand Down

0 comments on commit a1ed1eb

Please sign in to comment.