diff options
author | 2018-07-26 08:21:08 +0000 | |
---|---|---|
committer | 2018-07-26 08:21:08 +0000 | |
commit | 31dd6191211561ef72850c76eccdafcc34f35c56 (patch) | |
tree | 8abe3bfdce986cb32ec5157f8fa12a4355280f8d /CMakeLists.txt | |
parent | 1a79e5f0bbcb24ef72c872034451afb5c72b69ba (diff) | |
parent | 24326186db0be2afb04aebf3b1277495eaaec150 (diff) |
Merge "Feat: add commit message template and hook"
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a3c2a83..fbf5f4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,9 +37,23 @@ MESSAGE(STATUS "Shared library dir: " ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) add_custom_target(clean-cmake-files - COMMAND ${CMAKE_COMMAND} -P clean-all.cmake + COMMAND ${CMAKE_COMMAND} -P clean-all.cmake ) +execute_process(COMMAND git config --local --get commit.template + OUTPUT_VARIABLE commit_template) +if(commit_template STREQUAL "") + message(STATUS "Setting git commit template...") + execute_process(COMMAND git config --local commit.template ${CMAKE_SOURCE_DIR}/scripts/git/commit-msg-template) + message(STATUS "Setting git commit template...done") +endif() + +if(NOT EXISTS "${CMAKE_SOURCE_DIR}/.git/hooks/commit-msg") + message(STATUS "Setting git commit hook...") + execute_process(COMMAND ln -s ${CMAKE_SOURCE_DIR}/scripts/git/commit-msg-hook.py ${CMAKE_SOURCE_DIR}/.git/hooks/commit-msg) + message(STATUS "Setting git commit hook...done") +endif() + option(WITH_SECUREC_LIB "Option description" OFF) option(WITH_HAL_LIB "Option description" OFF) |