2009-11-26 19:25:32 +00:00
|
|
|
# vim: ts=4 sw=4 noet ai cindent syntax=cmake
|
2010-01-01 23:49:41 +00:00
|
|
|
#
|
|
|
|
# Conky, a system monitor, based on torsmo
|
|
|
|
#
|
|
|
|
# Please see COPYING for details
|
|
|
|
#
|
|
|
|
# Copyright (c) 2005-2010 Brenden Matthews, et. al. (see AUTHORS)
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
2009-11-26 19:25:32 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
include_directories(${conky_includes})
|
2010-01-17 02:00:51 +00:00
|
|
|
if(BUILD_BUILTIN_CONFIG)
|
2010-01-03 00:23:02 +00:00
|
|
|
# include config output dir
|
|
|
|
include_directories(${CMAKE_BINARY_DIR}/data)
|
2010-01-17 02:00:51 +00:00
|
|
|
endif(BUILD_BUILTIN_CONFIG)
|
2009-11-26 19:25:32 +00:00
|
|
|
|
2009-12-07 19:51:00 +00:00
|
|
|
# ensure build.h and config.h aren't in the way
|
2009-12-07 18:08:01 +00:00
|
|
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
|
|
|
|
message(FATAL_ERROR "You must remove the autotools generated file '${CMAKE_CURRENT_SOURCE_DIR}/config.h' in order to build with CMake.")
|
|
|
|
endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
|
2009-12-07 19:51:00 +00:00
|
|
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/build.h)
|
|
|
|
message(FATAL_ERROR "You must remove the autotools generated file '${CMAKE_CURRENT_SOURCE_DIR}/build.h' in order to build with CMake.")
|
|
|
|
endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/build.h)
|
2009-12-07 18:08:01 +00:00
|
|
|
|
2010-01-04 17:06:14 +00:00
|
|
|
set(conky_sources colours.cc combine.cc common.cc conky.cc core.cc
|
2010-02-08 23:28:33 +00:00
|
|
|
diskio.cc entropy.cc exec.cc fs.cc mail.cc mixer.cc net_stat.cc template.cc
|
2010-02-09 01:02:00 +00:00
|
|
|
mboxscan.cc read_tcp.cc scroll.cc specials.cc tailhead.cc
|
2010-02-09 12:11:56 +00:00
|
|
|
temphelper.cc text_object.cc timeinfo.cc top.cc algebra.cc prioqueue.c proc.cc
|
|
|
|
user.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
|
2010-01-13 18:52:35 +00:00
|
|
|
# add timed thread library
|
|
|
|
add_library(timed-thread timed-thread.cc)
|
|
|
|
set(conky_libs ${conky_libs} timed-thread)
|
|
|
|
|
2009-12-06 02:45:26 +00:00
|
|
|
# Platform specific sources
|
2009-12-07 17:35:43 +00:00
|
|
|
if(OS_LINUX)
|
2010-02-09 12:11:56 +00:00
|
|
|
set(linux linux.cc users.cc sony.cc i8k.cc)
|
2009-12-06 02:45:26 +00:00
|
|
|
set(optional_sources ${optional_sources} ${linux})
|
2009-12-07 17:35:43 +00:00
|
|
|
endif(OS_LINUX)
|
2009-12-05 20:00:10 +00:00
|
|
|
|
2009-12-07 17:35:43 +00:00
|
|
|
if(OS_FREEBSD)
|
2010-02-09 12:11:56 +00:00
|
|
|
set(freebsd freebsd.cc bsdapm.cc)
|
2009-12-06 02:45:26 +00:00
|
|
|
set(optional_sources ${optional_sources} ${freebsd})
|
2009-12-07 17:35:43 +00:00
|
|
|
endif(OS_FREEBSD)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-07 17:35:43 +00:00
|
|
|
if(OS_OPENBSD)
|
2010-02-09 12:11:56 +00:00
|
|
|
set(openbsd openbsd.cc bsdapm.cc)
|
2009-12-07 17:35:43 +00:00
|
|
|
set(optional_sources ${optional_sources} ${openbsd})
|
|
|
|
endif(OS_OPENBSD)
|
|
|
|
|
|
|
|
# These below are not actually supported. No idea what their status is.
|
|
|
|
if(OS_SOLARIS)
|
2010-02-09 12:11:56 +00:00
|
|
|
set(solaris solaris.cc)
|
2009-12-06 02:45:26 +00:00
|
|
|
set(optional_sources ${optional_sources} ${solaris})
|
2009-12-07 17:35:43 +00:00
|
|
|
endif(OS_SOLARIS)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-07 17:35:43 +00:00
|
|
|
if(OS_NETBSD)
|
2010-02-09 12:11:56 +00:00
|
|
|
set(netbsd netbsd.cc)
|
2009-12-06 02:45:26 +00:00
|
|
|
set(optional_sources ${optional_sources} ${netbsd})
|
2009-12-07 17:35:43 +00:00
|
|
|
endif(OS_NETBSD)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Optional sources
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_AUDACIOUS)
|
2010-01-04 17:06:14 +00:00
|
|
|
set(audacious audacious.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${audacious})
|
|
|
|
endif(BUILD_AUDACIOUS)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_BMPX)
|
2010-02-09 12:11:56 +00:00
|
|
|
set(bmpx bmpx.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${bmpx})
|
|
|
|
endif(BUILD_BMPX)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_IBM)
|
2010-01-04 17:06:14 +00:00
|
|
|
set(ibm ibm.cc smapi.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${ibm})
|
|
|
|
endif(BUILD_IBM)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_MPD)
|
2010-02-09 12:11:56 +00:00
|
|
|
set(mpd mpd.cc libmpdclient.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${mpd})
|
|
|
|
endif(BUILD_MPD)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_MOC)
|
2010-01-03 07:59:24 +00:00
|
|
|
set(moc moc.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${moc})
|
|
|
|
endif(BUILD_MOC)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_XMMS2)
|
2010-02-09 12:11:56 +00:00
|
|
|
set(xmms2 xmms2.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${xmms2})
|
|
|
|
endif(BUILD_XMMS2)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_PORT_MONITORS)
|
2009-12-10 23:19:13 +00:00
|
|
|
add_library(tcp-portmon libtcp-portmon.cc)
|
|
|
|
set(conky_libs ${conky_libs} tcp-portmon)
|
|
|
|
set(port_monitors tcp-portmon.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${port_monitors})
|
|
|
|
endif(BUILD_PORT_MONITORS)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_X11)
|
2010-02-09 12:11:56 +00:00
|
|
|
set(x11 x11.cc fonts.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${x11})
|
|
|
|
endif(BUILD_X11)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_HDDTEMP)
|
2010-01-04 17:06:14 +00:00
|
|
|
set(hddtemp hddtemp.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${hddtemp})
|
|
|
|
endif(BUILD_HDDTEMP)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_EVE)
|
2010-02-09 12:11:56 +00:00
|
|
|
set(eve eve.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${eve})
|
|
|
|
endif(BUILD_EVE)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_CURL)
|
2010-01-04 04:50:02 +00:00
|
|
|
set(ccurl_thread ccurl_thread.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${ccurl_thread})
|
|
|
|
endif(BUILD_CURL)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_RSS)
|
2010-02-09 12:11:56 +00:00
|
|
|
set(rss rss.cc prss.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${rss})
|
|
|
|
endif(BUILD_RSS)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_WEATHER)
|
2010-01-04 04:50:02 +00:00
|
|
|
set(weather weather.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${weather})
|
|
|
|
endif(BUILD_WEATHER)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_LUA)
|
2010-01-04 17:06:14 +00:00
|
|
|
set(lua llua.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${lua})
|
|
|
|
endif(BUILD_LUA)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_NVIDIA)
|
2010-01-06 19:57:13 +00:00
|
|
|
set(nvidia nvidia.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${nvidia})
|
|
|
|
endif(BUILD_NVIDIA)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_IMLIB2)
|
2010-01-10 21:04:15 +00:00
|
|
|
set(imlib2 imlib2.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${imlib2})
|
|
|
|
endif(BUILD_IMLIB2)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_APCUPSD)
|
2010-02-09 12:11:56 +00:00
|
|
|
set(apcupsd apcupsd.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${apcupsd})
|
|
|
|
endif(BUILD_APCUPSD)
|
2009-12-06 02:45:26 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
if(BUILD_ICONV)
|
2010-02-09 12:11:56 +00:00
|
|
|
set(iconv iconv_tools.cc)
|
2009-12-05 20:00:10 +00:00
|
|
|
set(optional_sources ${optional_sources} ${iconv})
|
|
|
|
endif(BUILD_ICONV)
|
|
|
|
|
2010-01-17 02:00:51 +00:00
|
|
|
if(BUILD_BUILTIN_CONFIG)
|
2010-01-03 00:23:02 +00:00
|
|
|
set(optional_sources ${optional_sources} conf_cookie.c)
|
2010-01-17 02:00:51 +00:00
|
|
|
endif(BUILD_BUILTIN_CONFIG)
|
2009-12-11 04:37:56 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
add_executable(conky ${conky_sources} ${optional_sources})
|
|
|
|
|
|
|
|
target_link_libraries(conky ${conky_libs})
|
2009-12-18 03:46:26 +00:00
|
|
|
|
|
|
|
# Install libtcp-portmon too?
|
|
|
|
install(TARGETS
|
|
|
|
conky
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
)
|