Don't overwrite conf files on install

This commit is contained in:
David Adrian 2013-10-12 13:44:33 -04:00
parent bc28a5a576
commit f6609beb2c
3 changed files with 11 additions and 6 deletions

1
.gitignore vendored
View File

@ -14,3 +14,4 @@ lexer.c
lexer.h
parser.c
parser.h
install_manifest.txt

View File

@ -64,9 +64,7 @@ set(CMAKE_C_FLAGS_RELEASE "-O2")
add_subdirectory(src)
# Install conf files
FILE(GLOB CONF_FILES "conf/*")
install(
FILES
${CONF_FILES}
DESTINATION "/etc/zmap/"
)
FILE(GLOB CONF_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/conf" "conf/*")
message(STATUS "${CONF_FILES}")
configure_file(zmap_conf_install.cmake.in zmap_conf_install.cmake)
install(SCRIPT zmap_conf_install.cmake)

View File

@ -0,0 +1,6 @@
foreach(conf_file ${CONF_FILES})
message(STATUS "${conf_file}")
if(NOT EXISTS "/etc/zmap/${conf_file}")
file(INSTALL "conf/${conf_file}" DESTINATION "/etc/zmap")
endif()
endforeach()