Mercurial > irccd
changeset 701:2007a37d7e1a
CMake: prefix options with IRCCD_, #closes 800 @2h
line wrap: on
line diff
--- a/CMakeLists.txt Wed May 09 22:34:47 2018 +0200 +++ b/CMakeLists.txt Wed May 16 12:25:51 2018 +0200 @@ -92,7 +92,7 @@ add_subdirectory(libirccdctl) add_subdirectory(libirccd-test) -if (HAVE_JS) +if (IRCCD_HAVE_JS) add_subdirectory(libirccd-js) endif () @@ -101,7 +101,7 @@ add_subdirectory(irccd-test) add_subdirectory(systemd) -if (HAVE_JS) +if (IRCCD_HAVE_JS) add_subdirectory(plugins) endif () @@ -111,7 +111,7 @@ endif () # Tests. -if (WITH_TESTS) +if (IRCCD_WITH_TESTS) include(CTest) add_subdirectory(tests) endif () @@ -123,20 +123,20 @@ message("") message("Compiling irccd with following options:") -message(" Libedit: ${WITH_LIBEDIT_MSG}") -message(" OpenSSL: ${WITH_SSL_MSG}") -message(" JS: ${WITH_JS_MSG}") -message(" Tests: ${WITH_TESTS_MSG}") -message(" User docs: ${WITH_HTML_MSG}") -message(" Doxygen: ${WITH_DOXYGEN_MSG}") +message(" Libedit: ${IRCCD_WITH_LIBEDIT_MSG}") +message(" OpenSSL: ${IRCCD_WITH_SSL_MSG}") +message(" Javascript: ${IRCCD_WITH_JS_MSG}") +message(" Tests: ${IRCCD_WITH_TESTS_MSG}") +message(" User docs: ${IRCCD_WITH_HTML_MSG}") +message(" Doxygen: ${IRCCD_WITH_DOXYGEN_MSG}") message(" Package: ${IRCCD_PACKAGE_MSG}") -message(" Vera: ${WITH_VERA_MSG}") +message(" Vera: ${IRCCD_WITH_VERA_MSG}") message("") message("Installing plugins:") foreach (plugin ${IRCCD_PLUGINS}) string(TOUPPER ${plugin} name) - irccd_indent_message(" ${plugin}: " "${WITH_PLUGIN_${name}_MSG}" 22) + irccd_indent_message(" ${plugin}: " "${IRCCD_WITH_PLUGIN_${name}_MSG}" 22) endforeach () message("")
--- a/MIGRATING.md Wed May 09 22:34:47 2018 +0200 +++ b/MIGRATING.md Wed May 16 12:25:51 2018 +0200 @@ -27,7 +27,9 @@ ### CMake options - - `WITH_CONFDIR` has been renamed to `WITH_SYSCONFDIR`. + - All options are now starting with `IRCCD_` for better compatibility with + external projects, + - `IRCCD_WITH_CONFDIR` has been renamed to `IRCCD_WITH_SYSCONFDIR`. ### Paths
--- a/cmake/IrccdOptions.cmake Wed May 09 22:34:47 2018 +0200 +++ b/cmake/IrccdOptions.cmake Wed May 16 12:25:51 2018 +0200 @@ -19,36 +19,36 @@ # # Options that controls the build: # -# WITH_DOCS Enable building of all documentation (default: on) -# WITH_DOXYGEN Enable internal irccd documentation (default: on) -# WITH_HTML Enable HTML documentation -# WITH_JS Enable JavaScript (default: on) -# WITH_LIBEDIT Enable libedit support (default: on) -# WITH_MAN Install manpages (default: on, off for Windows) -# WITH_PKGCONFIG Install pkg-config files (default: on, off for Windows (except MinGW)) -# WITH_PLUGIN_<NAME> Enable or disable the specified plugin (default: on) -# WITH_SSL Enable OpenSSL (default: on) -# WITH_SYSTEMD Install systemd service (default: on for Linux) -# WITH_TESTS Enable unit testing (default: off) -# WITH_VERA Enable style checking using vera (default: on) +# IRCCD_WITH_DOCS Enable building of all documentation (default: on) +# IRCCD_WITH_DOXYGEN Enable internal irccd documentation (default: on) +# IRCCD_WITH_HTML Enable HTML documentation +# IRCCD_WITH_JS Enable JavaScript (default: on) +# IRCCD_WITH_LIBEDIT Enable libedit support (default: on) +# IRCCD_WITH_MAN Install manpages (default: on, off for Windows) +# IRCCD_WITH_PKGCONFIG Install pkg-config files (default: on, off for Windows (except MinGW)) +# IRCCD_WITH_PLUGIN_<NAME> Enable or disable the specified plugin (default: on) +# IRCCD_WITH_SSL Enable OpenSSL (default: on) +# IRCCD_WITH_SYSTEMD Install systemd service (default: on for Linux) +# IRCCD_WITH_TESTS Enable unit testing (default: off) +# IRCCD_WITH_VERA Enable style checking using vera (default: on) # -# Note: the option() commands for WITH_PLUGIN_<name> variables are defined -# automatically from the IRCCD_PLUGINS list. +# Note: the option() commands for IRCCD_WITH_PLUGIN_<name> variables are +# defined automatically from the IRCCD_PLUGINS list. # # # Options that controls both installations and the irccd runtime: # -# WITH_BINDIR Binary directory for irccd, irccdctl -# WITH_CACHEDIR Path where to store temporary files -# WITH_CMAKEDIR Path where to install CMake configuration files -# WITH_DATADIR Path for data files -# WITH_DOCDIR Path where to install documentation -# WITH_MANDIR Path where to install manuals -# WITH_PKGCONFIGDIR Path where to install pkg-config files -# WITH_PLUGINDIR Path where plugins must be installed -# WITH_SYSCONFDIR Path where to install configuration files -# WITH_SYSTEMDDIR Path where to install systemd unit file +# IRCCD_WITH_BINDIR Binary directory for irccd, irccdctl +# IRCCD_WITH_CACHEDIR Path where to store temporary files +# IRCCD_WITH_CMAKEDIR Path where to install CMake configuration files +# IRCCD_WITH_DATADIR Path for data files +# IRCCD_WITH_DOCDIR Path where to install documentation +# IRCCD_WITH_MANDIR Path where to install manuals +# IRCCD_WITH_PKGCONFIGDIR Path where to install pkg-config files +# IRCCD_WITH_PLUGINDIR Path where plugins must be installed +# IRCCD_WITH_SYSCONFDIR Path where to install configuration files +# IRCCD_WITH_SYSTEMDDIR Path where to install systemd unit file # # Manual pages on Windows are pretty useless. @@ -72,51 +72,51 @@ set(DEFAULT_PKGCONFIG "No") endif () -option(WITH_DOCS "Enable building of all documentation" On) -option(WITH_DOXYGEN "Enable doxygen" Off) -option(WITH_HTML "Enable building of HTML documentation" On) -option(WITH_JS "Enable embedded Duktape" On) -option(WITH_LIBEDIT "Enable libedit support" On) -option(WITH_MAN "Install man pages" ${DEFAULT_MAN}) -option(WITH_PKGCONFIG "Enable pkg-config file" ${DEFAULT_PKGCONFIG}) -option(WITH_SSL "Enable SSL" On) -option(WITH_SYSTEMD "Install systemd service" ${DEFAULT_SYSTEMD}) -option(WITH_TESTS "Enable unit testing" Off) -option(WITH_VERA "Enable vera++" On) +option(IRCCD_WITH_DOCS "Enable building of all documentation" On) +option(IRCCD_WITH_DOXYGEN "Enable doxygen" Off) +option(IRCCD_WITH_HTML "Enable building of HTML documentation" On) +option(IRCCD_WITH_JS "Enable embedded Duktape" On) +option(IRCCD_WITH_LIBEDIT "Enable libedit support" On) +option(IRCCD_WITH_MAN "Install man pages" ${DEFAULT_MAN}) +option(IRCCD_WITH_PKGCONFIG "Enable pkg-config file" ${DEFAULT_PKGCONFIG}) +option(IRCCD_WITH_SSL "Enable SSL" On) +option(IRCCD_WITH_SYSTEMD "Install systemd service" ${DEFAULT_SYSTEMD}) +option(IRCCD_WITH_TESTS "Enable unit testing" Off) +option(IRCCD_WITH_VERA "Enable vera++" On) # # Installation paths. # ------------------------------------------------------------------- # -set(WITH_BINDIR "bin" CACHE STRING "Binary directory") -set(WITH_CACHEDIR "var/cache/irccd" CACHE STRING "Cache directory") -set(WITH_CMAKEDIR "lib/cmake" CACHE STRING "Directory for CMake modules") -set(WITH_DATADIR "share/irccd" CACHE STRING "Directory for additional data") -set(WITH_DOCDIR "share/doc/irccd" CACHE STRING "Documentation directory") -set(WITH_MANDIR "share/man" CACHE STRING "Man directory") -set(WITH_PKGCONFIGDIR "lib/pkgconfig" CACHE STRING "Directory for pkg-config file") -set(WITH_PLUGINDIR "libexec/irccd/plugins" CACHE STRING "Module prefix where to install") -set(WITH_SYSCONFDIR "etc/irccd" CACHE STRING "Configuration directory") -set(WITH_SYSTEMDDIR "/usr/lib/systemd/system" CACHE STRING "Absolute path where to install systemd files") +set(IRCCD_WITH_BINDIR "bin" CACHE STRING "Binary directory") +set(IRCCD_WITH_CACHEDIR "var/cache/irccd" CACHE STRING "Cache directory") +set(IRCCD_WITH_CMAKEDIR "lib/cmake" CACHE STRING "Directory for CMake modules") +set(IRCCD_WITH_DATADIR "share/irccd" CACHE STRING "Directory for additional data") +set(IRCCD_WITH_DOCDIR "share/doc/irccd" CACHE STRING "Documentation directory") +set(IRCCD_WITH_MANDIR "share/man" CACHE STRING "Man directory") +set(IRCCD_WITH_PKGCONFIGDIR "lib/pkgconfig" CACHE STRING "Directory for pkg-config file") +set(IRCCD_WITH_PLUGINDIR "libexec/irccd/plugins" CACHE STRING "Module prefix where to install") +set(IRCCD_WITH_SYSCONFDIR "etc/irccd" CACHE STRING "Configuration directory") +set(IRCCD_WITH_SYSTEMDDIR "/usr/lib/systemd/system" CACHE STRING "Absolute path where to install systemd files") # # Internal dependencies. # ------------------------------------------------------------------- # -if (WITH_JS) +if (IRCCD_WITH_JS) add_subdirectory(extern/duktape) - set(HAVE_JS On) - set(WITH_JS_MSG "Yes") + set(IRCCD_HAVE_JS On) + set(IRCCD_WITH_JS_MSG "Yes") else () - set(WITH_JS_MSG "No") + set(IRCCD_WITH_JS_MSG "No") endif () -if (WITH_TESTS) - set(WITH_TESTS_MSG "Yes") +if (IRCCD_WITH_TESTS) + set(IRCCD_WITH_TESTS_MSG "Yes") else () - set(WITH_TESTS_MSG "No") + set(IRCCD_WITH_TESTS_MSG "No") endif () # @@ -130,66 +130,66 @@ find_package(TCL QUIET) find_package(Editline) -if (NOT WITH_DOCS) - set(WITH_HTML FALSE) - set(WITH_DOXYGEN FALSE) - set(WITH_MAN FALSE) +if (NOT IRCCD_WITH_DOCS) + set(IRCCD_WITH_HTML FALSE) + set(IRCCD_WITH_DOXYGEN FALSE) + set(IRCCD_WITH_MAN FALSE) endif () -if (WITH_LIBEDIT) +if (IRCCD_WITH_LIBEDIT) if (Editline_FOUND) - set(HAVE_LIBEDIT On) - set(WITH_LIBEDIT_MSG "Yes") + set(IRCCD_HAVE_LIBEDIT On) + set(IRCCD_WITH_LIBEDIT_MSG "Yes") else () - set(WITH_LIBEDIT_MSG "No (libedit not found)") + set(IRCCD_WITH_LIBEDIT_MSG "No (libedit not found)") endif () else () - set(WITH_LIBEDIT_MSG "No (disabled by user)") + set(IRCCD_WITH_LIBEDIT_MSG "No (disabled by user)") endif () -if (WITH_SSL) +if (IRCCD_WITH_SSL) if (OPENSSL_FOUND) - set(HAVE_SSL On) - set(WITH_SSL_MSG "Yes") + set(IRCCD_HAVE_SSL On) + set(IRCCD_WITH_SSL_MSG "Yes") else () - set(WITH_SSL_MSG "No (OpenSSL not found)") + set(IRCCD_WITH_SSL_MSG "No (OpenSSL not found)") endif () else() - set(WITH_SSL_MSG "No (disabled by user)") + set(IRCCD_WITH_SSL_MSG "No (disabled by user)") endif () -if (WITH_DOXYGEN) +if (IRCCD_WITH_DOXYGEN) if (DOXYGEN_FOUND) - set(HAVE_DOXYGEN On) - set(WITH_DOXYGEN_MSG "Yes") + set(IRCCD_HAVE_DOXYGEN On) + set(IRCCD_WITH_DOXYGEN_MSG "Yes") else () - set(WITH_DOXYGEN_MSG "No (doxygen not found)") + set(IRCCD_WITH_DOXYGEN_MSG "No (doxygen not found)") endif () else () - set(WITH_DOXYGEN_MSG "No (disabled by user)") + set(IRCCD_WITH_DOXYGEN_MSG "No (disabled by user)") endif () -if (WITH_HTML) +if (IRCCD_WITH_HTML) if (Pandoc_FOUND) - set(HAVE_HTML On) - set(WITH_HTML_MSG "Yes") + set(IRCCD_HAVE_HTML On) + set(IRCCD_WITH_HTML_MSG "Yes") else () - set(WITH_HTML_MSG "No (pandoc not found)") + set(IRCCD_WITH_HTML_MSG "No (pandoc not found)") endif () else () - set(WITH_HTML_MSG "No (disabled by user)") + set(IRCCD_WITH_HTML_MSG "No (disabled by user)") endif () -if (WITH_VERA) +if (IRCCD_WITH_VERA) if (TCL_FOUND) add_subdirectory(extern/vera) - set(HAVE_VERA On) - set(WITH_VERA_MSG "Yes") + set(IRCCD_HAVE_VERA On) + set(IRCCD_WITH_VERA_MSG "Yes") else () - set(WITH_VERA_MSG "No (TCL not found)") + set(IRCCD_WITH_VERA_MSG "No (TCL not found)") endif () else () - set(WITH_VERA_MSG "No (disabled by user)") + set(IRCCD_WITH_VERA_MSG "No (disabled by user)") endif () # @@ -211,7 +211,7 @@ foreach (plugin ${IRCCD_PLUGINS}) string(TOUPPER ${plugin} optname) - if (NOT WITH_PLUGIN_${optname}) + if (NOT IRCCD_WITH_PLUGIN_${optname}) set(IRCCD_PACKAGE FALSE) set(IRCCD_PACKAGE_MSG "No (Plugin ${plugin} disabled)") endif ()
--- a/cmake/function/IrccdBuildHtml.cmake Wed May 09 22:34:47 2018 +0200 +++ b/cmake/function/IrccdBuildHtml.cmake Wed May 16 12:25:51 2018 +0200 @@ -129,7 +129,7 @@ install( FILES ${output} COMPONENT ${HTML_COMPONENT} - DESTINATION ${WITH_DOCDIR}/${dirname} + DESTINATION ${IRCCD_WITH_DOCDIR}/${dirname} ) endif ()
--- a/cmake/function/IrccdDefineExecutable.cmake Wed May 09 22:34:47 2018 +0200 +++ b/cmake/function/IrccdDefineExecutable.cmake Wed May 16 12:25:51 2018 +0200 @@ -74,7 +74,7 @@ install( TARGETS ${EXE_TARGET} COMPONENT ${EXE_TARGET} - RUNTIME DESTINATION ${WITH_BINDIR} + RUNTIME DESTINATION ${IRCCD_WITH_BINDIR} ) # Put the application into a cpack group.
--- a/cmake/function/IrccdDefineMan.cmake Wed May 09 22:34:47 2018 +0200 +++ b/cmake/function/IrccdDefineMan.cmake Wed May 16 12:25:51 2018 +0200 @@ -26,14 +26,14 @@ # file The file name to build # man The man section # -# This function configure the manual and install it if WITH_MAN is set. +# This function configure the manual and install it if IRCCD_WITH_MAN is set. # function(irccd_define_man file man) - if (WITH_MAN) + if (IRCCD_WITH_MAN) set(input ${doc_SOURCE_DIR}/man/${file}.in) set(output ${CMAKE_CURRENT_BINARY_DIR}/${file}) configure_file(${input} ${output} @ONLY) - install(FILES ${output} DESTINATION ${WITH_MANDIR}/${man}) + install(FILES ${output} DESTINATION ${IRCCD_WITH_MANDIR}/${man}) endif () endfunction()
--- a/cmake/function/IrccdDefinePlugin.cmake Wed May 09 22:34:47 2018 +0200 +++ b/cmake/function/IrccdDefinePlugin.cmake Wed May 16 12:25:51 2018 +0200 @@ -65,7 +65,7 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name} COMPONENT ${PLG_NAME} - DESTINATION ${WITH_PLUGINDIR} + DESTINATION ${IRCCD_WITH_PLUGINDIR} ) add_custom_target( @@ -86,7 +86,7 @@ install( TARGETS plugin-${PLG_NAME} COMPONENT ${PLG_NAME} - LIBRARY DESTINATION ${WITH_PLUGINDIR} + LIBRARY DESTINATION ${IRCCD_WITH_PLUGINDIR} ) endfunction() @@ -102,12 +102,12 @@ endif () string(TOUPPER ${PLG_NAME} PLG_UPPER_NAME) - option(WITH_PLUGIN_${PLG_UPPER_NAME} "Enable ${PLG_NAME} plugin" On) + option(IRCCD_WITH_PLUGIN_${PLG_UPPER_NAME} "Enable ${PLG_NAME} plugin" On) - if (NOT WITH_PLUGIN_${PLG_UPPER_NAME}) - setg(WITH_PLUGIN_${PLG_UPPER_NAME}_MSG "No (disabled by user)") + if (NOT IRCCD_WITH_PLUGIN_${PLG_UPPER_NAME}) + setg(IRCCD_WITH_PLUGIN_${PLG_UPPER_NAME}_MSG "No (disabled by user)") else () - setg(WITH_PLUGIN_${PLG_UPPER_NAME}_MSG "Yes") + setg(IRCCD_WITH_PLUGIN_${PLG_UPPER_NAME}_MSG "Yes") # Optional documentation. if (PLG_DOCS AND HAVE_HTML)
--- a/cmake/function/IrccdVeraCheck.cmake Wed May 09 22:34:47 2018 +0200 +++ b/cmake/function/IrccdVeraCheck.cmake Wed May 16 12:25:51 2018 +0200 @@ -24,14 +24,14 @@ # # Check the style source code using vera++. # -# No-op if HAVE_VERA is Off. +# No-op if IRCCD_HAVE_VERA is Off. # # This macro add a post-build command to call vera++ program on the specified # sources file for the given target. # function(irccd_vera_check target sources) - if (HAVE_VERA) + if (IRCCD_HAVE_VERA) set(valid ".cpp;.c;.hpp;.h") # Cleanup non relevant files.
--- a/cmake/internal/sysconfig.hpp.in Wed May 09 22:34:47 2018 +0200 +++ b/cmake/internal/sysconfig.hpp.in Wed May 16 12:25:51 2018 +0200 @@ -51,15 +51,15 @@ * ------------------------------------------------------------------ */ -#define WITH_CACHEDIR "@WITH_CACHEDIR@" -#define WITH_DATADIR "@WITH_DATADIR@" -#define WITH_BINDIR "@WITH_BINDIR@" -#define WITH_SYSCONFDIR "@WITH_SYSCONFDIR@" -#define WITH_PLUGINDIR "@WITH_PLUGINDIR@" +#define IRCCD_WITH_CACHEDIR "@IRCCD_WITH_CACHEDIR@" +#define IRCCD_WITH_DATADIR "@IRCCD_WITH_DATADIR@" +#define IRCCD_WITH_BINDIR "@IRCCD_WITH_BINDIR@" +#define IRCCD_WITH_SYSCONFDIR "@IRCCD_WITH_SYSCONFDIR@" +#define IRCCD_WITH_PLUGINDIR "@IRCCD_WITH_PLUGINDIR@" -#cmakedefine HAVE_JS -#cmakedefine HAVE_SSL -#cmakedefine HAVE_LIBEDIT +#cmakedefine IRCCD_HAVE_JS +#cmakedefine IRCCD_HAVE_SSL +#cmakedefine IRCCD_HAVE_LIBEDIT /* * Platform checks.
--- a/doc/CMakeLists.txt Wed May 09 22:34:47 2018 +0200 +++ b/doc/CMakeLists.txt Wed May 16 12:25:51 2018 +0200 @@ -18,13 +18,13 @@ project(doc) -if (HAVE_DOXYGEN) +if (IRCCD_HAVE_DOXYGEN) add_subdirectory(doxygen) endif () add_subdirectory(examples) #add_subdirectory(man) -if (HAVE_HTML) +if (IRCCD_HAVE_HTML) add_subdirectory(html) endif ()
--- a/doc/examples/CMakeLists.txt Wed May 09 22:34:47 2018 +0200 +++ b/doc/examples/CMakeLists.txt Wed May 16 12:25:51 2018 +0200 @@ -33,7 +33,7 @@ ${examples_SOURCE_DIR}/irccd.conf.sample ${examples_SOURCE_DIR}/irccdctl.conf.sample COMPONENT examples - DESTINATION ${WITH_SYSCONFDIR} + DESTINATION ${IRCCD_WITH_SYSCONFDIR} ) setg(CPACK_COMPONENT_EXAMPLES_HIDDEN On)
--- a/doc/html/CMakeLists.txt Wed May 09 22:34:47 2018 +0200 +++ b/doc/html/CMakeLists.txt Wed May 16 12:25:51 2018 +0200 @@ -198,12 +198,12 @@ install( FILES ${CSS} COMPONENT docs - DESTINATION ${WITH_DOCDIR}/css + DESTINATION ${IRCCD_WITH_DOCDIR}/css ) install( FILES ${JS} COMPONENT docs - DESTINATION ${WITH_DOCDIR}/js + DESTINATION ${IRCCD_WITH_DOCDIR}/js ) setg(CPACK_COMPONENT_DOCS_DISPLAY_NAME "Documentation")
--- a/doc/src/build.md Wed May 09 22:34:47 2018 +0200 +++ b/doc/src/build.md Wed May 16 12:25:51 2018 +0200 @@ -39,7 +39,7 @@ You can disable JavaScript support. - $ cmake .. -DWITH_JS=Off + $ cmake .. -DIRCCD_WITH_JS=Off ## Disabling SSL @@ -48,13 +48,20 @@ **Warning**: this is not recommended. - $ cmake .. -DWITH_SSL=Off + $ cmake .. -DIRCCD_WITH_SSL=Off + +## Disabling libedit + +If for some reasons, you don't want auto-completion in `irccd-test`, you can +disable it. + + $ cmake .. -DIRCCD_WITH_LIBEDIT=Off ## Disabling all documentation You can disable all the documentation. - $ cmake .. -DWITH_DOCS=Off + $ cmake .. -DIRCCD_WITH_DOCS=Off See below to disable only specific parts of the documentation. @@ -69,7 +76,7 @@ You can disable installation of manuals. - $ cmake .. -DWITH_MAN=Off + $ cmake .. -DIRCCD_WITH_MAN=Off ## Installation path @@ -89,4 +96,4 @@ For example, on FreeBSD the typical use would be: - $ cmake .. -DWITH_MANDIR=/usr/local/man + $ cmake .. -DIRCCD_WITH_MANDIR=/usr/local/man
--- a/irccd-test/CMakeLists.txt Wed May 09 22:34:47 2018 +0200 +++ b/irccd-test/CMakeLists.txt Wed May 16 12:25:51 2018 +0200 @@ -21,10 +21,10 @@ LIBRARIES libirccd libirccd-test - $<$<BOOL:${HAVE_LIBEDIT}>:${Editline_LIBRARIES}> - $<$<BOOL:${HAVE_JS}>:libirccd-js> + $<$<BOOL:${IRCCD_HAVE_LIBEDIT}>:${Editline_LIBRARIES}> + $<$<BOOL:${IRCCD_HAVE_JS}>:libirccd-js> INCLUDES - $<$<BOOL:${HAVE_LIBEDIT}>:${Editline_INCLUDE_DIRS}> + $<$<BOOL:${IRCCD_HAVE_LIBEDIT}>:${Editline_INCLUDE_DIRS}> DESCRIPTION "Plugin tester" SOURCES main.cpp )
--- a/irccd-test/main.cpp Wed May 09 22:34:47 2018 +0200 +++ b/irccd-test/main.cpp Wed May 16 12:25:51 2018 +0200 @@ -27,7 +27,7 @@ #include <boost/algorithm/string/trim.hpp> #include <boost/filesystem.hpp> -#if defined(HAVE_LIBEDIT) +#if defined(IRCCD_HAVE_LIBEDIT) # include <histedit.h> #endif @@ -42,7 +42,7 @@ #include <irccd/test/debug_server.hpp> -#if defined(HAVE_JS) +#if defined(IRCCD_HAVE_JS) # include <irccd/js/js_plugin.hpp> #endif @@ -472,7 +472,7 @@ // }}} -#if defined(HAVE_LIBEDIT) +#if defined(IRCCD_HAVE_LIBEDIT) // {{{ prompt (libedit version) @@ -620,7 +620,7 @@ { daemon = std::make_unique<irccd>(io); -#if defined(HAVE_JS) +#if defined(IRCCD_HAVE_JS) daemon->plugins().add_loader(js_plugin_loader::defaults(*daemon)); #endif
--- a/irccd/CMakeLists.txt Wed May 09 22:34:47 2018 +0200 +++ b/irccd/CMakeLists.txt Wed May 16 12:25:51 2018 +0200 @@ -27,5 +27,5 @@ $<$<BOOL:APPLE>:-Wno-deprecated-declarations> LIBRARIES libirccd - $<$<BOOL:${HAVE_JS}>:libirccd-js> + $<$<BOOL:${IRCCD_HAVE_JS}>:libirccd-js> )
--- a/irccd/main.cpp Wed May 09 22:34:47 2018 +0200 +++ b/irccd/main.cpp Wed May 16 12:25:51 2018 +0200 @@ -75,7 +75,7 @@ #include <irccd/daemon/service/server_service.hpp> #include <irccd/daemon/service/transport_service.hpp> -#if defined(HAVE_JS) +#if defined(IRCCD_HAVE_JS) # include <irccd/js/js_plugin.hpp> #endif @@ -111,10 +111,10 @@ bool ssl = false; bool js = false; -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) ssl = true; #endif -#if defined(HAVE_JS) +#if defined(IRCCD_HAVE_JS) js = true; #endif @@ -250,7 +250,7 @@ instance->transports().get_commands().push_back(std::make_unique<rule_move_command>()); instance->transports().get_commands().push_back(std::make_unique<rule_remove_command>()); -#if defined(HAVE_JS) +#if defined(IRCCD_HAVE_JS) instance->plugins().add_loader(js_plugin_loader::defaults(*instance)); #endif
--- a/irccdctl/main.cpp Wed May 09 22:34:47 2018 +0200 +++ b/irccdctl/main.cpp Wed May 16 12:25:51 2018 +0200 @@ -31,7 +31,7 @@ #include <irccd/string_util.hpp> #include <irccd/system.hpp> -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) # include <irccd/tls_connector.hpp> #endif @@ -153,7 +153,7 @@ const auto endpoints = resolve(host, port); if (string_util::is_boolean(sc.get("ssl").value())) { -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) // TODO: support more parameters. boost::asio::ssl::context ctx(boost::asio::ssl::context::sslv23);
--- a/libcommon/CMakeLists.txt Wed May 09 22:34:47 2018 +0200 +++ b/libcommon/CMakeLists.txt Wed May 16 12:25:51 2018 +0200 @@ -62,8 +62,8 @@ Threads::Threads Boost::filesystem Boost::system - $<$<BOOL:${HAVE_SSL}>:OpenSSL::Crypto> - $<$<BOOL:${HAVE_SSL}>:OpenSSL::SSL> + $<$<BOOL:${IRCCD_HAVE_SSL}>:OpenSSL::Crypto> + $<$<BOOL:${IRCCD_HAVE_SSL}>:OpenSSL::SSL> $<$<BOOL:${APPLE}>:resolv> $<$<BOOL:${WIN32}>:mswsock> $<$<BOOL:${WIN32}>:shlwapi>
--- a/libcommon/irccd/system.cpp Wed May 09 22:34:47 2018 +0200 +++ b/libcommon/irccd/system.cpp Wed May 16 12:25:51 2018 +0200 @@ -87,7 +87,7 @@ */ boost::filesystem::path base_directory() { - static const boost::filesystem::path bindir(WITH_BINDIR); + static const boost::filesystem::path bindir(IRCCD_WITH_BINDIR); static const boost::filesystem::path prefix(PREFIX); boost::filesystem::path path("."); @@ -121,7 +121,8 @@ * * Compute the system directory path for the given component. * - * Use with the build options like WITH_CACHEDIR, WITH_PLUGINDIR, ... + * Use with the build options like IRCCD_WITH_CACHEDIR, IRCCD_WITH_PLUGINDIR, + * ... * * Referenced by: * - cachedir, @@ -496,7 +497,7 @@ boost::filesystem::path cachedir() { - return system_directory(WITH_CACHEDIR); + return system_directory(IRCCD_WITH_CACHEDIR); } // }}} @@ -505,7 +506,7 @@ boost::filesystem::path datadir() { - return system_directory(WITH_DATADIR); + return system_directory(IRCCD_WITH_DATADIR); } // }}} @@ -514,7 +515,7 @@ boost::filesystem::path sysconfdir() { - return system_directory(WITH_SYSCONFDIR); + return system_directory(IRCCD_WITH_SYSCONFDIR); } // }}} @@ -523,7 +524,7 @@ boost::filesystem::path plugindir() { - return system_directory(WITH_PLUGINDIR); + return system_directory(IRCCD_WITH_PLUGINDIR); } // }}}
--- a/libcommon/irccd/system.hpp Wed May 09 22:34:47 2018 +0200 +++ b/libcommon/irccd/system.hpp Wed May 16 12:25:51 2018 +0200 @@ -112,8 +112,8 @@ #endif /** - * Get the cache directory as specified as compile time option WITH_CACHEDIR, if - * the value is absolute, it is returned as-is. + * Get the cache directory as specified as compile time option + * IRCCD_WITH_CACHEDIR, if the value is absolute, it is returned as-is. * * If the component is relative, it is evaluated using the binary executable * path. @@ -125,7 +125,7 @@ boost::filesystem::path cachedir(); /** - * Like cachedir but for WITH_DATADIR. + * Like cachedir but for IRCCD_WITH_DATADIR. * * \return the evaluated data directory. * \see cachedir @@ -134,7 +134,7 @@ boost::filesystem::path datadir(); /** - * Like cachedir but for WITH_SYSCONFIGDIR. + * Like cachedir but for IRCCD_WITH_SYSCONFIGDIR. * * \return the evaluated config directory. * \see cachedir @@ -144,7 +144,7 @@ boost::filesystem::path sysconfdir(); /** - * Like cachedir but for WITH_PLUGINDIR. + * Like cachedir but for IRCCD_WITH_PLUGINDIR. * * \return the evaluated system plugin directory. * \see cachedir
--- a/libcommon/irccd/tls_acceptor.hpp Wed May 09 22:34:47 2018 +0200 +++ b/libcommon/irccd/tls_acceptor.hpp Wed May 16 12:25:51 2018 +0200 @@ -26,7 +26,7 @@ #include <irccd/sysconfig.hpp> -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) #include "socket_acceptor.hpp" #include "tls_stream.hpp" @@ -91,6 +91,6 @@ } // !irccd -#endif // !HAVE_SSL +#endif // !IRCCD_HAVE_SSL #endif // !IRCCD_COMMON_TLS_ACCEPTOR_HPP
--- a/libcommon/irccd/tls_connector.hpp Wed May 09 22:34:47 2018 +0200 +++ b/libcommon/irccd/tls_connector.hpp Wed May 16 12:25:51 2018 +0200 @@ -26,7 +26,7 @@ #include <irccd/sysconfig.hpp> -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) #include "socket_connector.hpp" #include "tls_stream.hpp" @@ -90,6 +90,6 @@ } // !irccd -#endif // !HAVE_SSL +#endif // !IRCCD_HAVE_SSL #endif // !IRCCD_COMMON_TLS_CONNECTOR_HPP
--- a/libcommon/irccd/tls_stream.hpp Wed May 09 22:34:47 2018 +0200 +++ b/libcommon/irccd/tls_stream.hpp Wed May 16 12:25:51 2018 +0200 @@ -26,7 +26,7 @@ #include <irccd/sysconfig.hpp> -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) #include <boost/asio/ssl.hpp> @@ -59,6 +59,6 @@ } // !irccd -#endif // !HAVE_SSL +#endif // !IRCCD_HAVE_SSL #endif // !IRCCD_COMMON_TLS_STREAM_HPP
--- a/libirccd-test/CMakeLists.txt Wed May 09 22:34:47 2018 +0200 +++ b/libirccd-test/CMakeLists.txt Wed May 16 12:25:51 2018 +0200 @@ -32,11 +32,11 @@ ${libirccd-test_SOURCE_DIR}/irccd/test/plugin_cli_test.hpp ${libirccd-test_SOURCE_DIR}/irccd/test/rule_cli_test.cpp ${libirccd-test_SOURCE_DIR}/irccd/test/rule_cli_test.hpp - $<$<BOOL:${HAVE_JS}>:${libirccd-test_SOURCE_DIR}/irccd/test/plugin_test.cpp> - $<$<BOOL:${HAVE_JS}>:${libirccd-test_SOURCE_DIR}/irccd/test/plugin_test.hpp> - $<$<BOOL:${HAVE_JS}>:${libirccd-test_SOURCE_DIR}/irccd/test/js_test.hpp> + $<$<BOOL:${IRCCD_HAVE_JS}>:${libirccd-test_SOURCE_DIR}/irccd/test/plugin_test.cpp> + $<$<BOOL:${IRCCD_HAVE_JS}>:${libirccd-test_SOURCE_DIR}/irccd/test/plugin_test.hpp> + $<$<BOOL:${IRCCD_HAVE_JS}>:${libirccd-test_SOURCE_DIR}/irccd/test/js_test.hpp> LIBRARIES - $<$<BOOL:${HAVE_JS}>:libirccd-js> + $<$<BOOL:${IRCCD_HAVE_JS}>:libirccd-js> libirccd libirccdctl PUBLIC_INCLUDES
--- a/libirccd/irccd/daemon/irc.cpp Wed May 09 22:34:47 2018 +0200 +++ b/libirccd/irccd/daemon/irc.cpp Wed May 16 12:25:51 2018 +0200 @@ -239,7 +239,7 @@ wrap_send(socket_, handler); } -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) void tls_connection::do_connect(const std::string& host, const std::string& service, @@ -268,7 +268,7 @@ wrap_send(socket_, handler); } -#endif // !HAVE_SSL +#endif // !IRCCD_HAVE_SSL } // !irc
--- a/libirccd/irccd/daemon/irc.hpp Wed May 09 22:34:47 2018 +0200 +++ b/libirccd/irccd/daemon/irc.hpp Wed May 16 12:25:51 2018 +0200 @@ -33,7 +33,7 @@ #include <boost/asio.hpp> -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) # include <boost/asio/ssl.hpp> #endif @@ -535,7 +535,7 @@ } }; -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) /** * \brief SSL connection @@ -577,7 +577,7 @@ } }; -#endif // !HAVE_SSL +#endif // !IRCCD_HAVE_SSL } // !irc
--- a/libirccd/irccd/daemon/server.cpp Wed May 09 22:34:47 2018 +0200 +++ b/libirccd/irccd/daemon/server.cpp Wed May 16 12:25:51 2018 +0200 @@ -511,7 +511,7 @@ #endif if (flags_ & ssl) { -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) conn_ = std::make_shared<irc::tls_connection>(service_); #else /*
--- a/libirccd/irccd/daemon/server.hpp Wed May 09 22:34:47 2018 +0200 +++ b/libirccd/irccd/daemon/server.hpp Wed May 16 12:25:51 2018 +0200 @@ -588,7 +588,7 @@ */ inline void set_flags(std::uint8_t flags) noexcept { -#if !defined(HAVE_SSL) +#if !defined(IRCCD_HAVE_SSL) assert(!(flags & ssl)); #endif
--- a/libirccd/irccd/daemon/server_util.cpp Wed May 09 22:34:47 2018 +0200 +++ b/libirccd/irccd/daemon/server_util.cpp Wed May 16 12:25:51 2018 +0200 @@ -169,7 +169,7 @@ sv.set_flags(sv.get_flags() | server::join_invite); if (ssl.value_or(false)) -#if !defined(HAVE_SSL) +#if !defined(IRCCD_HAVE_SSL) throw server_error(server_error::ssl_disabled); #else sv.set_flags(sv.get_flags() | server::ssl);
--- a/libirccd/irccd/daemon/transport_server.cpp Wed May 09 22:34:47 2018 +0200 +++ b/libirccd/irccd/daemon/transport_server.cpp Wed May 16 12:25:51 2018 +0200 @@ -70,10 +70,10 @@ { "major", IRCCD_VERSION_MAJOR }, { "minor", IRCCD_VERSION_MINOR }, { "patch", IRCCD_VERSION_PATCH }, -#if defined(HAVE_JS) +#if defined(IRCCD_HAVE_JS) { "javascript", true }, #endif -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) { "ssl", true }, #endif });
--- a/libirccd/irccd/daemon/transport_util.cpp Wed May 09 22:34:47 2018 +0200 +++ b/libirccd/irccd/daemon/transport_util.cpp Wed May 16 12:25:51 2018 +0200 @@ -26,7 +26,7 @@ #include <irccd/string_util.hpp> #include <irccd/socket_acceptor.hpp> -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) # include <irccd/tls_acceptor.hpp> #endif @@ -101,7 +101,7 @@ auto acceptor = from_config_load_ip_acceptor(service, sc); if (string_util::is_boolean(sc.get("ssl").value())) { -#if !defined(HAVE_SSL) +#if !defined(IRCCD_HAVE_SSL) throw transport_error(transport_error::ssl_disabled); #else const auto key = sc.get("key").value();
--- a/systemd/CMakeLists.txt Wed May 09 22:34:47 2018 +0200 +++ b/systemd/CMakeLists.txt Wed May 16 12:25:51 2018 +0200 @@ -18,8 +18,8 @@ project(contrib) -if (WITH_SYSTEMD) - set(PATH "${CMAKE_INSTALL_PREFIX}/${WITH_BINDIR}/irccd") +if (IRCCD_WITH_SYSTEMD) + set(PATH "${CMAKE_INSTALL_PREFIX}/${IRCCD_WITH_BINDIR}/irccd") configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/irccd.service @@ -28,6 +28,6 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/irccd.service - DESTINATION ${WITH_SYSTEMDDIR} + DESTINATION ${IRCCD_WITH_SYSTEMDDIR} ) endif()
--- a/tests/CMakeLists.txt Wed May 09 22:34:47 2018 +0200 +++ b/tests/CMakeLists.txt Wed May 16 12:25:51 2018 +0200 @@ -28,7 +28,7 @@ add_subdirectory(src/libirccd) add_subdirectory(src/irccdctl) -if (HAVE_JS) +if (IRCCD_HAVE_JS) add_subdirectory(src/plugins) add_subdirectory(src/libirccd-js) endif ()
--- a/tests/src/irccdctl/CMakeLists.txt Wed May 09 22:34:47 2018 +0200 +++ b/tests/src/irccdctl/CMakeLists.txt Wed May 16 12:25:51 2018 +0200 @@ -16,7 +16,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # -if (HAVE_JS) +if (IRCCD_HAVE_JS) add_subdirectory(cli-plugin-config) add_subdirectory(cli-plugin-info) add_subdirectory(cli-plugin-list)
--- a/tests/src/irccdctl/cli-plugin-load/CMakeLists.txt Wed May 09 22:34:47 2018 +0200 +++ b/tests/src/irccdctl/cli-plugin-load/CMakeLists.txt Wed May 16 12:25:51 2018 +0200 @@ -16,13 +16,9 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # -if (NOT IS_ABSOLUTE WITH_PLUGINDIR) - file(WRITE "${CMAKE_BINARY_DIR}/${WITH_PLUGINDIR}/test-cli-plugin-load.js" "") - - irccd_define_test( - NAME cli-plugin-load - SOURCES main.cpp - LIBRARIES libcommon - DEPENDS irccd irccdctl - ) -endif () +irccd_define_test( + NAME cli-plugin-load + SOURCES main.cpp + LIBRARIES libcommon + DEPENDS irccd irccdctl +)
--- a/tests/src/libcommon/io/main.cpp Wed May 09 22:34:47 2018 +0200 +++ b/tests/src/libcommon/io/main.cpp Wed May 16 12:25:51 2018 +0200 @@ -27,16 +27,16 @@ #include <irccd/socket_connector.hpp> #include <irccd/socket_stream.hpp> -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) # include <irccd/tls_acceptor.hpp> # include <irccd/tls_connector.hpp> # include <irccd/tls_stream.hpp> -#endif // !HAVE_SSL +#endif // !IRCCD_HAVE_SSL using boost::asio::io_service; using boost::asio::ip::tcp; -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) using boost::asio::ssl::context; #endif @@ -110,7 +110,7 @@ } }; -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) class ssl_io_test : public io_test { private: @@ -144,7 +144,7 @@ } }; -#endif // !HAVE_SSL +#endif // !IRCCD_HAVE_SSL #if !BOOST_OS_WINDOWS @@ -178,7 +178,7 @@ */ using list = boost::mpl::list< ip_io_test -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) , ssl_io_test #endif #if !BOOST_OS_WINDOWS
--- a/tests/src/libirccd/command-server-connect/main.cpp Wed May 09 22:34:47 2018 +0200 +++ b/tests/src/libirccd/command-server-connect/main.cpp Wed May 16 12:25:51 2018 +0200 @@ -45,7 +45,7 @@ BOOST_TEST(s->get_port() == 6667U); } -#if defined(HAVE_SSL) +#if defined(IRCCD_HAVE_SSL) BOOST_AUTO_TEST_CASE(full) { @@ -84,7 +84,7 @@ BOOST_TEST(s->get_flags() & server::join_invite); } -#endif // !HAVE_SSL +#endif // !IRCCD_HAVE_SSL BOOST_AUTO_TEST_SUITE(errors) @@ -196,7 +196,7 @@ BOOST_TEST(result.first["errorCategory"].template get<std::string>() == "server"); } -#if !defined(HAVE_SSL) +#if !defined(IRCCD_HAVE_SSL) BOOST_AUTO_TEST_CASE(ssl_disabled) {
--- a/win32/CMakeLists.txt Wed May 09 22:34:47 2018 +0200 +++ b/win32/CMakeLists.txt Wed May 16 12:25:51 2018 +0200 @@ -46,7 +46,7 @@ # ------------------------------------------------------------------- # -if (HAVE_SSL) +if (IRCCD_HAVE_SSL) set(SSL_EAY_DLL libeay32.dll) set(SSL_LIB_DLL ssleay32.dll) list(APPEND DLLS SSL_EAY_DLL SSL_LIB_DLL) @@ -55,37 +55,37 @@ # # Find DLL to copy/install by iterating DLLS value. # -# Creates a cache WITH_<NAME> variable with the path to the DLL if found, +# Creates a cache IRCCD_WITH_<NAME> variable with the path to the DLL if found, # otherwise, set to not found. # -# If found, WITH_<NAME> is appended to IRCCD_DLLS global variable and set as +# If found, IRCCD_WITH_<NAME> is appended to IRCCD_DLLS global variable and set as # parent scope. # -# If not found, WITH_<NAME> is appended to IRCCD_DLLS_NOT_FOUND variable. +# If not found, IRCCD_WITH_<NAME> is appended to IRCCD_DLLS_NOT_FOUND variable. # foreach (name ${DLLS}) find_program( - WITH_${name} + IRCCD_WITH_${name} NAMES ${${name}} DOC "Path to DLL" ) - if (EXISTS ${WITH_${name}}) + if (EXISTS ${IRCCD_WITH_${name}}) file( - COPY ${WITH_${name}} - DESTINATION ${IRCCD_FAKEROOTDIR}/${WITH_BINDIR} + COPY ${IRCCD_WITH_${name}} + DESTINATION ${IRCCD_FAKEROOTDIR}/${IRCCD_WITH_BINDIR} ) install( - PROGRAMS ${WITH_${name}} + PROGRAMS ${IRCCD_WITH_${name}} COMPONENT libirccd DESTINATION bin ) - list(APPEND IRCCD_DLLS WITH_${name}) + list(APPEND IRCCD_DLLS IRCCD_WITH_${name}) else () set(IRCCD_PACKAGE Off PARENT_SCOPE) set(IRCCD_PACKAGE_MSG "No (some .dll were not found)" PARENT_SCOPE) - list(APPEND IRCCD_DLLS_NOT_FOUND WITH_${name}) + list(APPEND IRCCD_DLLS_NOT_FOUND IRCCD_WITH_${name}) endif () endforeach ()