From f24d97b510c6a8435c102eecf84526bc96015612 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sun, 5 Apr 2015 21:26:39 +0200 Subject: [PATCH] Fix compiling if sourcery is pre-existing and binary dir and source dir are equal. --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25104339..0e46c222 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -333,9 +333,13 @@ endif(DOXYGEN_FOUND) # Sourcery # ######################################## if (EXISTS "${SOURCE_DIR}/sourcery") - add_custom_target(sourcery - COMMAND cp ${SOURCE_DIR}/sourcery ${BINARY_DIR}/sourcery - ) + if (EXISTS "${BINARY_DIR}/sourcery") + add_custom_target(sourcery ) + else() + add_custom_target(sourcery + COMMAND cp ${SOURCE_DIR}/sourcery ${BINARY_DIR}/sourcery + ) + endif() else() add_executable(sourcery src/sourcery.cpp