diff options
author | yexin <yexin13@huawei.com> | 2018-07-20 16:48:42 +0800 |
---|---|---|
committer | yalei wang <wylandrea@gmail.com> | 2018-07-26 08:17:55 +0000 |
commit | 24326186db0be2afb04aebf3b1277495eaaec150 (patch) | |
tree | 4bc54362e52ebc06b911d21ed287d7e533f63d32 /CMakeLists.txt | |
parent | 739fa21ba9d85582a2a996ad02d885acc4d4efe1 (diff) |
Feat: add commit message template and hook
Use cmake to install the template and hook.
Change-Id: Ie86ad2e1a4d1fe1999941445be969618b192eb32
Signed-off-by: yexin <yexin13@huawei.com>
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) |