2014-11-13 01:04:59 +02:00
|
|
|
project(kdesu)
|
|
|
|
|
2015-11-01 15:08:31 +02:00
|
|
|
include_directories(${KDE4_KPTY_INCLUDES})
|
2014-11-13 01:04:59 +02:00
|
|
|
|
|
|
|
check_function_exists(setpriority HAVE_SETPRIORITY)
|
|
|
|
check_function_exists(getpeereid HAVE_GETPEEREID)
|
|
|
|
|
|
|
|
set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
|
2015-11-01 15:08:31 +02:00
|
|
|
# defines HAVE_STRUCT_UCRED (bool) and STRUCT_UCRED (size, unused)
|
|
|
|
check_type_size("struct ucred" STRUCT_UCRED)
|
|
|
|
# reset CMAKE_EXTRA_INCLUDE_FILES
|
|
|
|
set(CMAKE_EXTRA_INCLUDE_FILES)
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
config-kdesu.h.cmake
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/config-kdesu.h
|
|
|
|
)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2015-07-11 15:58:07 +03:00
|
|
|
find_package(Sudo)
|
2015-11-01 15:08:31 +02:00
|
|
|
set_package_properties(Sudo PROPERTIES
|
|
|
|
DESCRIPTION "Sudo allows a system administrator to delegate authority to give certain users"
|
|
|
|
URL "http://www.sudo.ws/"
|
|
|
|
PURPOSE "Needed for password caching in kdesu"
|
|
|
|
)
|
2015-07-11 15:58:07 +03:00
|
|
|
|
2014-11-13 01:04:59 +02:00
|
|
|
########### next target ###############
|
|
|
|
|
|
|
|
set(kdesu_LIB_SRCS
|
2015-09-01 01:05:33 +03:00
|
|
|
client.cpp
|
|
|
|
process.cpp
|
|
|
|
kcookie.cpp
|
|
|
|
su.cpp
|
|
|
|
ssh.cpp
|
|
|
|
stub.cpp
|
|
|
|
)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2015-09-01 01:05:33 +03:00
|
|
|
add_library(kdesu ${LIBRARY_TYPE} ${kdesu_LIB_SRCS})
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2015-11-01 15:08:31 +02:00
|
|
|
target_link_libraries(kdesu PRIVATE ${KDE4_KPTY_LIBS})
|
|
|
|
target_link_libraries(kdesu PUBLIC ${QT_QTCORE_LIBRARY})
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2015-07-11 15:58:07 +03:00
|
|
|
if(SUDO_FOUND)
|
2015-09-01 01:05:33 +03:00
|
|
|
add_definitions(-DKDESU_USE_SUDO_DEFAULT)
|
2015-11-01 15:08:31 +02:00
|
|
|
endif()
|
2014-11-13 01:04:59 +02:00
|
|
|
|
|
|
|
set_target_properties(kdesu PROPERTIES
|
2015-01-24 21:45:28 +00:00
|
|
|
VERSION ${GENERIC_LIB_VERSION}
|
|
|
|
SOVERSION ${GENERIC_LIB_SOVERSION}
|
2014-11-13 01:04:59 +02:00
|
|
|
)
|
|
|
|
|
2015-11-01 15:08:31 +02:00
|
|
|
install(
|
|
|
|
TARGETS kdesu
|
|
|
|
EXPORT kdelibsLibraryTargets
|
|
|
|
${INSTALL_TARGETS_DEFAULT_ARGS}
|
|
|
|
)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
|
|
|
########### next target ###############
|
|
|
|
|
|
|
|
set(kdesu_stub_SRCS kdesu_stub.c )
|
|
|
|
|
2015-09-01 01:05:33 +03:00
|
|
|
add_executable(kdesu_stub ${kdesu_stub_SRCS})
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2015-11-01 15:08:31 +02:00
|
|
|
install(TARGETS kdesu_stub DESTINATION ${LIBEXEC_INSTALL_DIR})
|
2014-11-13 01:04:59 +02:00
|
|
|
|
|
|
|
########### install files ###############
|
|
|
|
|
2015-11-01 15:08:31 +02:00
|
|
|
install(
|
|
|
|
FILES
|
2015-09-01 01:05:33 +03:00
|
|
|
kdesu_export.h
|
|
|
|
client.h
|
|
|
|
process.h
|
|
|
|
su.h
|
|
|
|
ssh.h
|
|
|
|
stub.h
|
|
|
|
defaults.h
|
|
|
|
DESTINATION ${INCLUDE_INSTALL_DIR}/kdesu
|
|
|
|
COMPONENT Devel
|
|
|
|
)
|