mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Install example config files dynamically.
They'll only get installed when the distribution version differs from existing version on disk.
This commit is contained in:
parent
0e5bc16a60
commit
ca95ad9618
3 changed files with 16 additions and 6 deletions
|
@ -3,7 +3,6 @@ include(InstallClobberImmune)
|
|||
# This macro can be used to install configuration files which
|
||||
# users are expected to modify after installation. It will:
|
||||
#
|
||||
# - Always install one version of the file with a .example suffix
|
||||
# - If binary packaging is enabled:
|
||||
# Install the file in the typical CMake fashion, but append to the
|
||||
# INSTALLED_CONFIG_FILES cache variable for use with the Mac package's
|
||||
|
@ -19,10 +18,6 @@ include(InstallClobberImmune)
|
|||
macro(InstallPackageConfigFile _srcfile _dstdir _dstfilename)
|
||||
set(_dstfile ${_dstdir}/${_dstfilename})
|
||||
|
||||
# Always install the latest version of the file renamed as an example
|
||||
install(FILES ${_srcfile} DESTINATION ${_dstdir}
|
||||
RENAME ${_dstfilename}.example)
|
||||
|
||||
if (BINARY_PACKAGING_MODE)
|
||||
# If packaging mode is enabled, always install the distribution's
|
||||
# version of the file. The Mac package's pre/post install scripts
|
||||
|
@ -32,6 +27,14 @@ macro(InstallPackageConfigFile _srcfile _dstdir _dstfilename)
|
|||
# use to avoid clobbering user-modified config files
|
||||
set(INSTALLED_CONFIG_FILES
|
||||
"${INSTALLED_CONFIG_FILES} ${_dstfile}" CACHE STRING "" FORCE)
|
||||
|
||||
# Additionally, the Mac PackageMaker packages don't have any automatic
|
||||
# handling of configuration file conflicts so install an example file
|
||||
# that the post install script will cleanup in the case it's extraneous
|
||||
if (APPLE)
|
||||
install(FILES ${_srcfile} DESTINATION ${_dstdir}
|
||||
RENAME ${_dstfilename}.example)
|
||||
endif ()
|
||||
else ()
|
||||
# Have `make install` check at run time whether the file does not exist
|
||||
InstallClobberImmune(${_srcfile} ${_dstfile})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue