2010-01-01 23:49:41 +00:00
|
|
|
#
|
|
|
|
# Conky, a system monitor, based on torsmo
|
|
|
|
#
|
|
|
|
# Please see COPYING for details
|
|
|
|
#
|
2024-02-22 13:33:31 +00:00
|
|
|
# Copyright (c) 2005-2024 Brenden Matthews, et. al. (see AUTHORS) All rights
|
2018-12-23 21:38:00 +00:00
|
|
|
# reserved.
|
2010-01-01 23:49:41 +00:00
|
|
|
#
|
2018-12-23 21:38:00 +00:00
|
|
|
# This program is free software: you can redistribute it and/or modify it under
|
|
|
|
# the terms of the GNU General Public License as published by the Free Software
|
|
|
|
# Foundation, either version 3 of the License, or (at your option) any later
|
|
|
|
# version.
|
2010-01-01 23:49:41 +00:00
|
|
|
#
|
2018-12-23 21:38:00 +00:00
|
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
# details. You should have received a copy of the GNU General Public License
|
2010-01-01 23:49:41 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
2009-12-05 21:04:31 +00:00
|
|
|
|
2023-11-10 11:31:01 +00:00
|
|
|
include(CMakeDependentOption)
|
|
|
|
include(DependentOption)
|
|
|
|
|
2009-12-08 04:46:49 +00:00
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
2018-12-23 21:38:00 +00:00
|
|
|
if(MAINTAINER_MODE)
|
|
|
|
set(
|
|
|
|
CMAKE_BUILD_TYPE Debug
|
|
|
|
CACHE
|
2024-02-22 13:33:31 +00:00
|
|
|
STRING
|
|
|
|
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
2018-12-23 21:38:00 +00:00
|
|
|
FORCE)
|
|
|
|
else(MAINTAINER_MODE)
|
|
|
|
set(
|
|
|
|
CMAKE_BUILD_TYPE RelWithDebInfo
|
|
|
|
CACHE
|
2024-02-22 13:33:31 +00:00
|
|
|
STRING
|
|
|
|
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
2018-12-23 21:38:00 +00:00
|
|
|
FORCE)
|
|
|
|
endif(MAINTAINER_MODE)
|
2009-12-08 04:46:49 +00:00
|
|
|
endif(NOT CMAKE_BUILD_TYPE)
|
|
|
|
|
2009-12-11 16:15:44 +00:00
|
|
|
# -std options for all build types
|
2022-10-12 18:31:23 +00:00
|
|
|
set(CMAKE_C_STANDARD 99)
|
2018-05-12 23:26:31 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
2021-04-24 15:29:50 +00:00
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
2009-12-11 16:15:44 +00:00
|
|
|
|
2010-01-01 21:50:12 +00:00
|
|
|
if(MAINTAINER_MODE)
|
2022-12-27 13:46:45 +00:00
|
|
|
set(CMAKE_COMPILE_WARNING_AS_ERROR true)
|
2018-12-23 21:38:00 +00:00
|
|
|
set(BUILD_TESTS true)
|
2021-02-28 20:46:17 +00:00
|
|
|
endif(MAINTAINER_MODE)
|
2018-12-23 21:38:00 +00:00
|
|
|
|
2022-12-27 13:46:45 +00:00
|
|
|
# Always use libc++ when compiling w/ clang
|
|
|
|
add_compile_options($<$<COMPILE_LANG_AND_ID:CXX,Clang>:-stdlib=libc++>)
|
|
|
|
add_link_options($<$<COMPILE_LANG_AND_ID:CXX,Clang>:-stdlib=libc++>)
|
|
|
|
|
2018-05-13 17:33:18 +00:00
|
|
|
option(CHECK_CODE_QUALITY "Check code formatting/quality with clang" false)
|
|
|
|
|
2009-12-08 04:46:49 +00:00
|
|
|
option(RELEASE "Build release package" false)
|
|
|
|
mark_as_advanced(RELEASE)
|
|
|
|
|
2019-03-27 18:58:20 +00:00
|
|
|
option(MAINTAINER_MODE "Enable maintainer mode" false)
|
2022-12-26 16:46:29 +00:00
|
|
|
option(CODE_COVERAGE "Enable code coverage report generation" false)
|
2019-03-27 18:58:20 +00:00
|
|
|
|
2022-10-14 13:35:47 +00:00
|
|
|
option(BUILD_DOCS "Build documentation" false)
|
|
|
|
option(BUILD_EXTRAS "Build extras (includes syntax files for editors)" false)
|
2009-12-19 19:39:16 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
option(BUILD_I18N "Enable if you want internationalization support" true)
|
2024-02-22 13:33:31 +00:00
|
|
|
|
2010-11-13 18:45:04 +00:00
|
|
|
if(BUILD_I18N)
|
2018-12-23 21:38:00 +00:00
|
|
|
set(LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/share/locale"
|
2024-02-22 13:33:31 +00:00
|
|
|
CACHE STRING "Directory containing the locales")
|
2010-11-13 18:45:04 +00:00
|
|
|
endif(BUILD_I18N)
|
2010-10-30 22:02:02 +00:00
|
|
|
|
2009-12-05 21:04:31 +00:00
|
|
|
# Some standard options
|
2018-12-23 21:38:00 +00:00
|
|
|
set(SYSTEM_CONFIG_FILE "/etc/conky/conky.conf"
|
2024-02-22 13:33:31 +00:00
|
|
|
CACHE STRING "Default system-wide Conky configuration file")
|
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
# use FORCE below to make sure this changes when CMAKE_INSTALL_PREFIX is
|
|
|
|
# modified
|
|
|
|
if(NOT LIB_INSTALL_DIR)
|
|
|
|
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
|
|
|
|
endif(NOT LIB_INSTALL_DIR)
|
2024-02-22 13:33:31 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
set(PACKAGE_LIBRARY_DIR "${LIB_INSTALL_DIR}/conky"
|
2024-02-22 13:33:31 +00:00
|
|
|
CACHE STRING "Package library path (where Lua bindings are installed"
|
|
|
|
FORCE)
|
2019-02-25 16:51:43 +00:00
|
|
|
set(DEFAULTNETDEV "eno1" CACHE STRING "Default networkdevice")
|
2018-08-07 15:54:01 +00:00
|
|
|
|
|
|
|
# Mac only override
|
|
|
|
if(OS_DARWIN)
|
2018-12-23 21:38:00 +00:00
|
|
|
set(DEFAULTNETDEV "en0" CACHE STRING "Default networkdevice" FORCE)
|
2018-08-07 15:54:01 +00:00
|
|
|
endif(OS_DARWIN)
|
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
set(XDG_CONFIG_FILE "$HOME/.config/conky/conky.conf"
|
2024-02-22 13:33:31 +00:00
|
|
|
CACHE STRING "Configfile of the user (XDG)")
|
2010-11-23 18:18:47 +00:00
|
|
|
set(CONFIG_FILE "$HOME/.conkyrc" CACHE STRING "Configfile of the user")
|
2018-12-23 21:38:00 +00:00
|
|
|
set(MAX_USER_TEXT_DEFAULT "16384"
|
2024-02-22 13:33:31 +00:00
|
|
|
CACHE STRING
|
|
|
|
"Default maximum size of config TEXT buffer, i.e. below TEXT line.")
|
2018-12-23 21:38:00 +00:00
|
|
|
set(DEFAULT_TEXT_BUFFER_SIZE "256"
|
2024-02-22 13:33:31 +00:00
|
|
|
CACHE STRING "Default size used for temporary, static text buffers")
|
2019-04-03 12:17:53 +00:00
|
|
|
set(MAX_NET_INTERFACES "256" CACHE STRING "Maximum number of network devices")
|
2009-12-05 21:04:31 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
# Platform specific options Linux only
|
2023-11-10 11:31:01 +00:00
|
|
|
cmake_dependent_option(BUILD_PORT_MONITORS "Build TCP portmon support" true
|
|
|
|
"OS_LINUX" false)
|
|
|
|
cmake_dependent_option(BUILD_IBM "Support for IBM/Lenovo notebooks" true
|
|
|
|
"OS_LINUX" false)
|
|
|
|
cmake_dependent_option(BUILD_HDDTEMP "Support for hddtemp" true
|
|
|
|
"OS_LINUX" false)
|
|
|
|
cmake_dependent_option(BUILD_IPV6 "Enable if you want IPv6 support" true
|
|
|
|
"OS_LINUX" false)
|
2023-11-10 23:25:23 +00:00
|
|
|
|
|
|
|
if(OS_LINUX)
|
|
|
|
# nvidia may also work on FreeBSD, not sure
|
|
|
|
# NvCtrl requires X11. Should be modified to use NVML directly.
|
|
|
|
dependent_option(BUILD_NVIDIA "Enable Nvidia NvCtrl variables" false
|
|
|
|
"BUILD_X11" false
|
|
|
|
"Nvidia NvCtrl variables require X11")
|
|
|
|
else()
|
|
|
|
set(BUILD_NVIDIA false CACHE BOOL "Enable Nvidia NvCtrl variables" FORCE)
|
|
|
|
endif(OS_LINUX)
|
2009-12-06 19:43:12 +00:00
|
|
|
|
2018-08-07 15:54:01 +00:00
|
|
|
# macOS Only
|
2023-11-10 11:31:01 +00:00
|
|
|
cmake_dependent_option(
|
|
|
|
BUILD_IPGFREQ
|
|
|
|
"Enable cpu freq calculation based on Intel® Power Gadget; otherwise use constant factory value"
|
|
|
|
false
|
|
|
|
"OS_DARWIN" false)
|
2018-08-07 15:54:01 +00:00
|
|
|
|
2009-12-05 21:04:31 +00:00
|
|
|
# Optional features etc
|
2018-08-07 15:54:01 +00:00
|
|
|
option(BUILD_WLAN "Enable wireless support" false)
|
|
|
|
|
2010-01-17 02:00:51 +00:00
|
|
|
option(BUILD_BUILTIN_CONFIG "Enable builtin default configuration" true)
|
2009-12-11 04:37:56 +00:00
|
|
|
|
2010-12-09 17:55:22 +00:00
|
|
|
option(BUILD_IOSTATS "Enable disk I/O stats" true)
|
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
option(BUILD_OLD_CONFIG "Enable support for the old syntax of configurations"
|
2024-02-22 13:33:31 +00:00
|
|
|
true)
|
2010-11-19 13:27:18 +00:00
|
|
|
|
2009-12-11 04:37:56 +00:00
|
|
|
option(BUILD_MATH "Enable math support" true)
|
|
|
|
|
|
|
|
option(BUILD_NCURSES "Enable ncurses support" true)
|
2023-11-10 11:31:01 +00:00
|
|
|
|
|
|
|
dependent_option(LEAKFREE_NCURSES
|
|
|
|
"Enable to hide false ncurses-memleaks in valgrind (works only when ncurses is compiled with --disable-leaks)"
|
|
|
|
false
|
|
|
|
"BUILD_NCURSES" false
|
|
|
|
"LEAKFREE_NCURSES requires ncurses")
|
2009-12-11 04:37:56 +00:00
|
|
|
|
2022-12-25 13:06:09 +00:00
|
|
|
option(BUILD_WAYLAND "Build Wayland support" false)
|
2022-11-28 19:23:23 +00:00
|
|
|
|
2009-12-05 21:04:31 +00:00
|
|
|
option(BUILD_X11 "Build X11 support" true)
|
2023-11-10 11:31:01 +00:00
|
|
|
|
|
|
|
dependent_option(OWN_WINDOW "Enable running conky in a dedicated window" true
|
|
|
|
"BUILD_X11" false
|
|
|
|
"Dedicated window mode only works on X11")
|
|
|
|
|
|
|
|
# On MacOS these cause issues so they're disabled by default
|
|
|
|
if(OS_DARWIN)
|
|
|
|
dependent_option(BUILD_XDAMAGE "Build Xdamage support" false
|
|
|
|
"BUILD_X11" false
|
|
|
|
"Xdamage support requires X11")
|
|
|
|
dependent_option(BUILD_XFIXES "Build Xfixes support" false
|
|
|
|
"BUILD_X11" false
|
|
|
|
"Xfixes support requires X11")
|
|
|
|
else()
|
|
|
|
dependent_option(BUILD_XDAMAGE "Build Xdamage support" true
|
|
|
|
"BUILD_X11" false
|
|
|
|
"Xdamage support requires X11")
|
|
|
|
dependent_option(BUILD_XFIXES "Build Xfixes support" true
|
|
|
|
"BUILD_X11" false
|
|
|
|
"Xfixes support requires X11")
|
|
|
|
endif(OS_DARWIN)
|
|
|
|
|
2023-11-10 20:25:45 +00:00
|
|
|
dependent_option(BUILD_ARGB "Build ARGB (real transparency) support" true
|
2023-11-10 22:07:02 +00:00
|
|
|
"BUILD_X11;OWN_WINDOW" false
|
|
|
|
"ARGB support requires X11 and OWN_WINDOW enabled, not needed on Wayland")
|
2023-11-10 11:31:01 +00:00
|
|
|
dependent_option(BUILD_XINERAMA "Build Xinerama support" true
|
|
|
|
"BUILD_X11" false
|
|
|
|
"Xinerama support requires X11")
|
|
|
|
dependent_option(BUILD_XDBE "Build Xdbe (double-buffer) support" true
|
|
|
|
"BUILD_X11" false
|
|
|
|
"Xdbe based double-buffering requires X11")
|
|
|
|
dependent_option(BUILD_XFT "Build Xft (freetype fonts) support" true
|
|
|
|
"BUILD_X11" false
|
|
|
|
"Xft (freetype font) support requires X11")
|
|
|
|
dependent_option(BUILD_IMLIB2 "Enable Imlib2 support" true
|
|
|
|
"BUILD_X11" false
|
|
|
|
"Imlib2 support requires X11")
|
|
|
|
dependent_option(BUILD_XSHAPE "Enable Xshape support" true
|
|
|
|
"BUILD_X11" false
|
|
|
|
"Xshape support requires X11")
|
2023-11-10 20:25:45 +00:00
|
|
|
dependent_option(BUILD_XINPUT "Build Xinput 2 support" true
|
|
|
|
"BUILD_X11;BUILD_MOUSE_EVENTS" false
|
|
|
|
"Xinput 2 support requires X11 and BUILD_MOUSE_EVENTS enabled")
|
2009-12-05 21:04:31 +00:00
|
|
|
|
2018-10-05 01:40:02 +00:00
|
|
|
# if we build with any GUI support
|
|
|
|
if(BUILD_X11)
|
|
|
|
set(BUILD_GUI true)
|
|
|
|
endif(BUILD_X11)
|
2024-02-22 13:33:31 +00:00
|
|
|
|
2022-11-28 19:23:23 +00:00
|
|
|
if(BUILD_WAYLAND)
|
|
|
|
set(BUILD_GUI true)
|
|
|
|
endif(BUILD_WAYLAND)
|
2018-10-05 01:40:02 +00:00
|
|
|
|
2023-11-10 11:31:01 +00:00
|
|
|
dependent_option(BUILD_MOUSE_EVENTS "Enable mouse event support" true
|
|
|
|
"BUILD_WAYLAND OR OWN_WINDOW" false
|
|
|
|
"Mouse event support requires Wayland or OWN_WINDOW enabled")
|
|
|
|
|
|
|
|
# Lua library options
|
2010-11-14 00:41:07 +00:00
|
|
|
option(BUILD_LUA_CAIRO "Build cairo bindings for Lua" false)
|
2023-11-10 11:31:01 +00:00
|
|
|
dependent_option(BUILD_LUA_IMLIB2 "Build Imlib2 bindings for Lua" false
|
|
|
|
"BUILD_X11;BUILD_IMLIB2" false
|
|
|
|
"Imlib2 Lua bindings require X11 and Imlib2")
|
2013-05-22 20:21:29 +00:00
|
|
|
option(BUILD_LUA_RSVG "Build rsvg bindings for Lua" false)
|
2009-12-06 19:30:06 +00:00
|
|
|
|
2009-12-08 04:46:49 +00:00
|
|
|
option(BUILD_AUDACIOUS "Build audacious (music player) support" false)
|
2009-12-06 19:30:06 +00:00
|
|
|
|
2009-12-08 04:46:49 +00:00
|
|
|
option(BUILD_MPD "Enable if you want MPD (music player) support" true)
|
|
|
|
|
2012-06-28 16:56:01 +00:00
|
|
|
option(BUILD_MYSQL "Enable if you want MySQL support" false)
|
2010-04-18 15:52:41 +00:00
|
|
|
|
2009-12-08 04:46:49 +00:00
|
|
|
option(BUILD_MOC "Enable if you want MOC (music player) support" true)
|
|
|
|
|
|
|
|
option(BUILD_XMMS2 "Enable if you want XMMS2 (music player) support" false)
|
|
|
|
|
|
|
|
option(BUILD_CURL "Enable if you want Curl support" false)
|
|
|
|
|
2023-11-10 11:31:01 +00:00
|
|
|
dependent_option(BUILD_RSS "Enable if you want RSS support" false
|
|
|
|
"BUILD_CURL" false
|
|
|
|
"RSS depends on Curl support")
|
2022-10-12 16:53:09 +00:00
|
|
|
|
2009-12-11 04:37:56 +00:00
|
|
|
option(BUILD_APCUPSD "Enable APCUPSD support" true)
|
2010-01-20 17:17:30 +00:00
|
|
|
|
2010-04-27 19:14:32 +00:00
|
|
|
option(BUILD_ICAL "Enable if you want iCalendar (RFC 5545) support" false)
|
2010-04-27 14:42:21 +00:00
|
|
|
|
2010-04-30 17:32:42 +00:00
|
|
|
option(BUILD_IRC "Enable if you want IRC support" false)
|
|
|
|
|
2010-06-04 12:41:12 +00:00
|
|
|
option(BUILD_HTTP "Enable if you want HTTP support" false)
|
2024-02-22 13:33:31 +00:00
|
|
|
|
2010-11-24 17:17:53 +00:00
|
|
|
if(BUILD_HTTP)
|
2018-12-23 21:38:00 +00:00
|
|
|
set(HTTPPORT "10080" CACHE STRING "Port to use for out_to_http")
|
2010-11-24 17:17:53 +00:00
|
|
|
endif(BUILD_HTTP)
|
2010-06-04 12:41:12 +00:00
|
|
|
|
2010-01-20 17:17:30 +00:00
|
|
|
option(BUILD_ICONV "Enable iconv support" false)
|
2011-05-10 20:40:53 +00:00
|
|
|
|
2018-05-13 17:33:18 +00:00
|
|
|
option(BUILD_CMUS "Enable support for cmus music player" true)
|
2016-05-06 11:25:30 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
option(BUILD_JOURNAL "Enable support for reading from the systemd journal"
|
2024-02-22 13:33:31 +00:00
|
|
|
false)
|
2016-06-24 14:17:20 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
option(BUILD_PULSEAUDIO
|
2024-02-22 13:33:31 +00:00
|
|
|
"Enable support for Pulseaudio's default sink and source" false)
|
2018-12-22 21:16:28 +00:00
|
|
|
|
2021-04-20 22:10:00 +00:00
|
|
|
option(BUILD_INTEL_BACKLIGHT
|
2024-02-22 13:33:31 +00:00
|
|
|
"Enable support for Intel backlight" false)
|
2021-04-20 22:10:00 +00:00
|
|
|
|
2023-11-10 20:25:45 +00:00
|
|
|
run_dependency_checks()
|
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS})
|
|
|
|
message(STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS})
|
2018-12-22 21:16:28 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
message(STATUS "CMAKE_C_FLAGS_DEBUG: " ${CMAKE_C_FLAGS_DEBUG})
|
|
|
|
message(STATUS "CMAKE_CXX_FLAGS_DEBUG: " ${CMAKE_CXX_FLAGS_DEBUG})
|
2018-12-22 21:16:28 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
message(STATUS "CMAKE_C_FLAGS_MINSIZEREL: " ${CMAKE_C_FLAGS_MINSIZEREL})
|
|
|
|
message(STATUS "CMAKE_CXX_FLAGS_MINSIZEREL: " ${CMAKE_CXX_FLAGS_MINSIZEREL})
|
2018-12-22 21:16:28 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
message(STATUS "CMAKE_C_FLAGS_RELEASE: " ${CMAKE_C_FLAGS_RELEASE})
|
|
|
|
message(STATUS "CMAKE_CXX_FLAGS_RELEASE: " ${CMAKE_CXX_FLAGS_RELEASE})
|
2018-12-22 21:16:28 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
message(STATUS "CMAKE_C_FLAGS_RELWITHDEBINFO: " ${CMAKE_C_FLAGS_RELWITHDEBINFO})
|
|
|
|
message(STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO: "
|
2024-02-22 13:33:31 +00:00
|
|
|
${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
|
2018-12-22 21:16:28 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
message(STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE})
|