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.
This commit is contained in:
Laurent Rineau 2018-04-13 11:28:17 +02:00
parent 2fa8ee5864
commit 7cc46441b5
2 changed files with 7 additions and 3 deletions

View File

@ -864,8 +864,10 @@ endif()
if(NOT CGAL_HEADER_ONLY) if(NOT CGAL_HEADER_ONLY)
create_CGALconfig_files() create_CGALconfig_files()
else() else()
configure_file("${CGAL_MODULES_DIR}/CGALConfig_binary_header_only.cmake.in" if(NOT EXISTS "${CMAKE_BINARY_DIR}/CGALConfig.cmake")
"${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY) configure_file("${CGAL_MODULES_DIR}/CGALConfig_binary_header_only.cmake.in"
"${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY)
endif()
endif() endif()
#-------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------

View File

@ -135,7 +135,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CGAL_RUNTIME_DIR})
# TODO: Seems useless, because it is called again in ../CMakeLists.txt # TODO: Seems useless, because it is called again in ../CMakeLists.txt
# Should probably be removed. -- Laurent Rineau, 2014/07/22 # 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}) set(CGAL_DIR ${CMAKE_BINARY_DIR})