From f42004b4a14d86bbf233549ff38f5aef5851df26 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 26 Apr 2017 15:18:32 -0400 Subject: [PATCH 1/2] don't overwrite zm.conf --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index baba4218d..4a89d9f2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -733,7 +733,12 @@ else(zmconfgen_result EQUAL 0) endif(zmconfgen_result EQUAL 0) # Install zm.conf -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zm.conf" DESTINATION "${ZM_CONFIG_DIR}") +install(CODE " + if (NOT EXISTS \"${ZM_CONFIG_DIR}/zm.conf\") + file(INSTALL \"${CMAKE_CURRENT_BINARY_DIR}/zm.conf\" DESTINATION \"${ZM_CONFIG_DIR}\") + endif() + ") + # Uninstall target configure_file( @@ -749,3 +754,4 @@ if(CCACHE_FOUND) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif(CCACHE_FOUND) + From ec85d9a6a7a6ae695d142fba8afd289e6923acb8 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 10 May 2017 08:57:47 -0400 Subject: [PATCH 2/2] if zm.conf exists, rename to zm.conf.new --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a89d9f2f..06840686b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -736,6 +736,9 @@ endif(zmconfgen_result EQUAL 0) install(CODE " if (NOT EXISTS \"${ZM_CONFIG_DIR}/zm.conf\") file(INSTALL \"${CMAKE_CURRENT_BINARY_DIR}/zm.conf\" DESTINATION \"${ZM_CONFIG_DIR}\") + else (NOT EXISTS \"${ZM_CONFIG_DIR}/zm.conf\") + file(RENAME \"${CMAKE_CURRENT_BINARY_DIR}/zm.conf\" \"${CMAKE_CURRENT_BINARY_DIR}/zm.conf.new\") + file(INSTALL \"${CMAKE_CURRENT_BINARY_DIR}/zm.conf.new\" DESTINATION \"${ZM_CONFIG_DIR}\") endif() ")