2014-11-13 19:30:51 +02:00
|
|
|
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
cmake_minimum_required(VERSION 2.6.2)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/CContLib/ )
|
|
|
|
|
|
|
|
# Laurent: Verify that we install it into (kdeprefix)/etc/ and not into /etc
|
|
|
|
# otherwise it's necessary to change it.
|
|
|
|
# into kde 3.x it was installed into /etc/
|
2020-02-08 19:29:32 +00:00
|
|
|
add_definitions( -DKSYSGUARDDRCFILE="\\"${KDE4_SYSCONF_INSTALL_DIR}/ksysguarddrc\\"" )
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
|
|
macro_optional_find_package(Sensors)
|
|
|
|
macro_bool_to_01(SENSORS_FOUND HAVE_LMSENSORS)
|
|
|
|
|
|
|
|
check_include_files(sys/inotify.h SYS_INOTIFY_H_FOUND)
|
|
|
|
macro_bool_to_01(SYS_INOTIFY_H_FOUND HAVE_SYS_INOTIFY_H)
|
|
|
|
|
|
|
|
|
|
|
|
configure_file(config-ksysguardd.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-ksysguardd.h)
|
|
|
|
|
2021-02-01 07:15:09 +02:00
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "(Linux|GNU)")
|
|
|
|
add_definitions(-DOSTYPE_${CMAKE_SYSTEM_NAME})
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Linux)
|
|
|
|
include(Linux/Linux.cmake)
|
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
|
|
|
|
add_definitions(-DOSTYPE_${CMAKE_SYSTEM_NAME})
|
2020-02-05 14:30:37 +00:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/FreeBSD)
|
2020-12-25 01:53:05 +00:00
|
|
|
include(FreeBSD/FreeBSD.cmake)
|
2020-12-28 18:00:49 +02:00
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "(SunOS|Solaris)")
|
2021-02-01 07:15:09 +02:00
|
|
|
add_definitions(-DOSTYPE_Solaris)
|
2020-02-05 14:30:37 +00:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Solaris)
|
2021-02-01 07:15:09 +02:00
|
|
|
include(Solaris/Solaris.cmake)
|
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "(NetBSD|OpenBSD")
|
|
|
|
add_definitions(-DOSTYPE_${CMAKE_SYSTEM_NAME})
|
2020-02-05 14:30:37 +00:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_SYSTEM_NAME})
|
|
|
|
include(${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_NAME}.cmake)
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "ksysguardd does not support: ${CMAKE_SYSTEM_NAME}")
|
|
|
|
endif()
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
|
|
########### next target ###############
|
|
|
|
|
2020-02-05 14:30:37 +00:00
|
|
|
set(ksysguardd_SRCS
|
|
|
|
CContLib/ccont.c
|
|
|
|
Command.c
|
|
|
|
conf.c
|
|
|
|
ksysguardd.c
|
|
|
|
PWUIDCache.c
|
|
|
|
${LIBKSYSGUARDD_SOURCES}
|
|
|
|
)
|
2014-11-13 19:30:51 +02:00
|
|
|
|
2020-02-05 14:30:37 +00:00
|
|
|
add_executable(ksysguardd ${ksysguardd_SRCS})
|
2014-11-13 19:30:51 +02:00
|
|
|
|
2020-02-05 14:30:37 +00:00
|
|
|
target_link_libraries(ksysguardd ${LIBKSYSGUARDD_LIBS})
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
|
|
if( ${CMAKE_SYSTEM_NAME} MATCHES "DragonFly" )
|
|
|
|
message(STATUS "Adding kinfo library on DragonFly BSD")
|
|
|
|
target_link_libraries(ksysguardd kinfo)
|
2020-02-05 14:30:37 +00:00
|
|
|
endif()
|
2014-11-13 19:30:51 +02:00
|
|
|
|
|
|
|
install(TARGETS ksysguardd ${INSTALL_TARGETS_DEFAULT_ARGS})
|