diff --git a/cmake_modules/ConkyBuildOptions.cmake b/cmake_modules/ConkyBuildOptions.cmake index bb340807..b7cd9d1a 100644 --- a/cmake_modules/ConkyBuildOptions.cmake +++ b/cmake_modules/ConkyBuildOptions.cmake @@ -1,6 +1,5 @@ # vim: ts=4 sw=4 noet ai cindent syntax=cmake - # Some standard options set(SYSTEM_CONFIG_FILE "/etc/conky/conky.conf" CACHE STRING "Default system-wide Conky configuration file") # use FORCE below to make sure this changes when CMAKE_INSTALL_PREFIX is modified diff --git a/cmake_modules/ConkyPlatformChecks.cmake b/cmake_modules/ConkyPlatformChecks.cmake index ec70ed78..0146fff7 100644 --- a/cmake_modules/ConkyPlatformChecks.cmake +++ b/cmake_modules/ConkyPlatformChecks.cmake @@ -9,6 +9,31 @@ check_include_files(sys/inotify.h HAVE_SYS_INOTIFY_H) # standard path to search for includes set(INCLUDE_SEARCH_PATH /usr/include /usr/local/include) +# Set system vars +if(CMAKE_SYSTEM_NAME MATCHES "Linux") + set(OS_LINUX true) +endif(CMAKE_SYSTEM_NAME MATCHES "Linux") + +if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(OS_FREEBSD true) +endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + +if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") + set(OS_OPENBSD true) +endif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") + +if(CMAKE_SYSTEM_NAME MATCHES "Solaris") + set(OS_SOLARIS true) +endif(CMAKE_SYSTEM_NAME MATCHES "Solaris") + +if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") + set(OS_NETBSD true) +endif(CMAKE_SYSTEM_NAME MATCHES "NetBSD") + +if(NOT OS_LINUX AND NOT OS_FREEBSD AND NOT OS_OPENBSD) + message(FATAL_ERROR "Your platform, '${CMAKE_SYSTEM_NAME}', is not currently supported. Patches are welcome.") +endif(NOT OS_LINUX AND NOT OS_FREEBSD AND NOT OS_OPENBSD) + # check for Xlib if(BUILD_X11) include(FindX11) diff --git a/config.h.in b/config.h.in index a44b8171..3fc7eb1d 100644 --- a/config.h.in +++ b/config.h.in @@ -1,5 +1,6 @@ #cmakedefine DEBUG +#define SYSTEM_NAME "@CMAKE_SYSTEM_NAME@" #define PACKAGE_NAME "@PROJECT_NAME@" #define VERSION "@VERSION@" #define SYSTEM_CONFIG_FILE "@SYSTEM_CONFIG_FILE@" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9916ed46..56b92630 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,30 +8,31 @@ set(conky_sources colours.c combine.c common.c conky.c core.c diskio.c text_object.c timeinfo.c top.c algebra.c proc.c user.c) # Platform specific sources -if(CMAKE_SYSTEM_NAME MATCHES "Linux") +if(OS_LINUX) set(linux linux.c linux.h users.c users.h sony.c sony.h i8k.c i8k.h) set(optional_sources ${optional_sources} ${linux}) -endif(CMAKE_SYSTEM_NAME MATCHES "Linux") +endif(OS_LINUX) -if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") +if(OS_FREEBSD) set(freebsd freebsd.c freebsd.h bsdapm.c bsdapm.h) set(optional_sources ${optional_sources} ${freebsd}) -endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") +endif(OS_FREEBSD) -if(CMAKE_SYSTEM_NAME MATCHES "Solaris") - set(solaris solaris.c) - set(optional_sources ${optional_sources} ${solaris}) -endif(CMAKE_SYSTEM_NAME MATCHES "Solaris") - -if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") - set(netbsd netbsd.c netbsd.h) - set(optional_sources ${optional_sources} ${netbsd}) -endif(CMAKE_SYSTEM_NAME MATCHES "NetBSD") - -if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") +if(OS_OPENBSD) set(openbsd openbsd.c openbsd.h bsdapm.c bsdapm.h) set(optional_sources ${optional_sources} ${openbsd}) -endif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") +endif(OS_OPENBSD) + +# These below are not actually supported. No idea what their status is. +if(OS_SOLARIS) + set(solaris solaris.c) + set(optional_sources ${optional_sources} ${solaris}) +endif(OS_SOLARIS) + +if(OS_NETBSD) + set(netbsd netbsd.c netbsd.h) + set(optional_sources ${optional_sources} ${netbsd}) +endif(OS_NETBSD) # Optional sources