From 7cc46441b5728c0b9bff433005537051d491ac1a Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 13 Apr 2018 11:28:17 +0200 Subject: [PATCH] Do not overwrite source files! Fixes #3016. Now the `CGALConfig.cmake` at the root of the Git repository is not modified, even with an in-source configuration. --- Installation/CMakeLists.txt | 6 ++++-- Installation/src/CMakeLists.txt | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 73386fe866f..dff9443245f 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -864,8 +864,10 @@ endif() if(NOT CGAL_HEADER_ONLY) create_CGALconfig_files() else() - configure_file("${CGAL_MODULES_DIR}/CGALConfig_binary_header_only.cmake.in" - "${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY) + if(NOT EXISTS "${CMAKE_BINARY_DIR}/CGALConfig.cmake") + configure_file("${CGAL_MODULES_DIR}/CGALConfig_binary_header_only.cmake.in" + "${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY) + endif() endif() #-------------------------------------------------------------------------------------------------- diff --git a/Installation/src/CMakeLists.txt b/Installation/src/CMakeLists.txt index d201c9ebcb0..caf995799b3 100644 --- a/Installation/src/CMakeLists.txt +++ b/Installation/src/CMakeLists.txt @@ -135,7 +135,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CGAL_RUNTIME_DIR}) # TODO: Seems useless, because it is called again in ../CMakeLists.txt # Should probably be removed. -- Laurent Rineau, 2014/07/22 -create_CGALconfig_files() +if(NOT CGAL_HEADER_ONLY) + create_CGALconfig_files() +endif() set(CGAL_DIR ${CMAKE_BINARY_DIR})