Skip to content

Commit

Permalink
[FIX] Use configure_file only for configuring out-of-source, then use…
Browse files Browse the repository at this point in the history
… file(COPY).
  • Loading branch information
janstrohbeck committed Mar 28, 2019
1 parent 672ff12 commit a803b64
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,33 @@ function(create_git_hook)
else()
configure_file(
"${GCF_DIR}/pre-commit.template.sh"
"${GCF_GIT_DIR}/hooks/pre-commit"
"${CMAKE_CURRENT_BINARY_DIR}/pre-commit"
@ONLY)
file(COPY
"${CMAKE_CURRENT_BINARY_DIR}/pre-commit"
DESTINATION
"${GCF_GIT_DIR}/hooks"
)

get_filename_component(GCF_PROJECT_NAME "${CMAKE_BINARY_DIR}" NAME)
configure_file(
"${GCF_DIR}/project.template.yaml"
"${GCF_GIT_DIR}/hooks/.${GCF_PROJECT_NAME}.config.yaml"
"${CMAKE_CURRENT_BINARY_DIR}/.${GCF_PROJECT_NAME}.config.yaml"
@ONLY)
file(COPY
"${CMAKE_CURRENT_BINARY_DIR}/.${GCF_PROJECT_NAME}.config.yaml"
DESTINATION
"${GCF_GIT_DIR}/hooks/"
)

configure_file(
"${GCF_DIR}/run_hooks.template.sh"
"${GCF_GIT_ROOT}/run_hooks"
"${CMAKE_CURRENT_BINARY_DIR}/run_hooks"
@ONLY)
file(COPY
"${CMAKE_CURRENT_BINARY_DIR}/run_hooks"
DESTINATION
"${GCF_GIT_ROOT}/"
)
endif()
endfunction()

0 comments on commit a803b64

Please sign in to comment.