2025-02-01 12:11:37 +01:00
|
|
|
cmake_minimum_required(VERSION 3.30)
|
2024-02-19 12:52:17 +01:00
|
|
|
project(isolationrunner)
|
2021-05-21 11:53:22 +02:00
|
|
|
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
2024-02-16 16:54:09 +01:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2021-05-21 11:53:22 +02:00
|
|
|
|
2024-05-17 11:39:44 +02:00
|
|
|
find_package(Qt6 COMPONENTS Core Widgets DBus REQUIRED)
|
2021-05-21 11:53:22 +02:00
|
|
|
|
|
|
|
|
# starting with Qt5.15 we have a lot of deprecation warnings,
|
|
|
|
|
# likely to make porting to Qt6 easier.
|
|
|
|
|
# as long as we require linking to older Qt versions those warnings
|
|
|
|
|
# are clutter. Remove this define when we start porting to Qt6.
|
|
|
|
|
add_definitions(-DQT_NO_DEPRECATED_WARNINGS)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set (SERVER_SOURCES
|
|
|
|
|
main.cpp
|
|
|
|
|
DBusConnection.cpp
|
|
|
|
|
Message.cpp
|
|
|
|
|
RemoteRunner.cpp
|
|
|
|
|
Runner.cpp
|
2024-02-19 12:52:17 +01:00
|
|
|
IsolationManager.cpp
|
2021-05-21 11:53:22 +02:00
|
|
|
)
|
|
|
|
|
|
2024-02-19 12:52:17 +01:00
|
|
|
add_executable(isolation_runner ${SERVER_SOURCES})
|
2024-05-17 11:39:44 +02:00
|
|
|
target_link_libraries(isolation_runner Qt6::Core Qt6::DBus Qt6::Widgets)
|
2021-05-21 11:53:22 +02:00
|
|
|
|
2024-02-18 23:49:55 +01:00
|
|
|
if ("$ENV{HOME}" STREQUAL "/root") # hacky way to know if we're root.
|
|
|
|
|
# setuid is needed, we can apply that when root installs it.
|
2024-02-19 12:52:17 +01:00
|
|
|
install (PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/isolation_runner
|
2024-02-18 23:49:55 +01:00
|
|
|
PERMISSIONS
|
|
|
|
|
OWNER_WRITE OWNER_READ OWNER_EXECUTE
|
|
|
|
|
GROUP_READ GROUP_EXECUTE
|
|
|
|
|
WORLD_READ WORLD_EXECUTE
|
|
|
|
|
SETUID
|
|
|
|
|
DESTINATION bin)
|
|
|
|
|
else ()
|
2024-02-19 12:52:17 +01:00
|
|
|
install (PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/isolation_runner DESTINATION bin)
|
2024-02-18 23:49:55 +01:00
|
|
|
endif ()
|
2021-05-21 11:53:22 +02:00
|
|
|
|
2021-05-21 13:22:26 +02:00
|
|
|
|
|
|
|
|
set (UTIL_SOURCES
|
|
|
|
|
util/client.cpp
|
|
|
|
|
)
|
2024-02-19 12:52:17 +01:00
|
|
|
add_executable(iso ${UTIL_SOURCES})
|
|
|
|
|
target_link_libraries(iso Qt6::Core Qt6::DBus)
|
|
|
|
|
install (PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/iso DESTINATION bin)
|