Skip to content

Instantly share code, notes, and snippets.

@usagi
Last active February 23, 2016 15:08
Show Gist options
  • Select an option

  • Save usagi/1208f5ee5b01bdce9a54 to your computer and use it in GitHub Desktop.

Select an option

Save usagi/1208f5ee5b01bdce9a54 to your computer and use it in GitHub Desktop.
Git が dirty か判定する方法と CMake での応用例 ref: http://qiita.com/usagi/items/34e65259b4fdbd2c245e
git diff --shortstat --exit-code --quiet
execute_process(
COMMAND git diff --shortstat --exit-code --quiet
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE version_git_dirty_flag
)
if( version_git_dirty_flag )
message( "repository is dirty." )
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment