OPTION(ENABLE_URL_INCLUDE "Enable urls in ucl includes (requires libcurl or libfetch) [default: OFF]" OFF)
OPTION(NO_SHARED "Build internal libs static [default: ON]" ON)
OPTION(INSTALL_WEBUI "Install web interface [default: ON]" ON)
+OPTION(INSTALL_EXAMPLES "Install examples of the configuration and Lua [default: ON]" ON)
OPTION(WANT_SYSTEMD_UNITS "Install systemd unit files on Linux [default: OFF]" OFF)
OPTION(ENABLE_SNOWBALL "Enable snowball stemmer [default: ON]" ON)
OPTION(ENABLE_CLANG_PLUGIN "Enable clang static analysing plugin [default: OFF]" OFF)
LIST(LENGTH CONFFILES CONFLIST_COUNT)
MATH(EXPR CONFLIST_MAX ${CONFLIST_COUNT}-1)
+SET(GLOB_PATTERNS "${CMAKE_SOURCE_DIR}/conf/*.conf;${CMAKE_SOURCE_DIR}/conf/*.inc")
+IF(INSTALL_EXAMPLES MATCHES "ON")
+ LIST(APPEND GLOB_PATTERNS "${CMAKE_SOURCE_DIR}/conf/*.lua.example")
+ LIST(APPEND GLOB_PATTERNS "${CMAKE_SOURCE_DIR}/conf/*.conf.example")
+ENDIF()
+
FILE(GLOB_RECURSE CONF_FILES RELATIVE "${CMAKE_SOURCE_DIR}/conf" CONFIGURE_DEPENDS
- "${CMAKE_SOURCE_DIR}/conf/*.conf"
- "${CMAKE_SOURCE_DIR}/conf/*.inc"
- "${CMAKE_SOURCE_DIR}/conf/*.lua.example"
- "${CMAKE_SOURCE_DIR}/conf/*.conf.example")
+ ${GLOB_PATTERNS})
FOREACH (CONF_FILE ${CONF_FILES})
GET_FILENAME_COMPONENT(_rp ${CONF_FILE} PATH)
INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${CONFDIR}/${_rp})")