Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to new build system: cmake #50

Merged
merged 3 commits into from Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
117 changes: 117 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,117 @@
cmake_minimum_required(VERSION 3.1)

project(mce LANGUAGES C VERSION 1.9)

set(MCE_CONF_DIR /etc/mce)
set(MCE_CONF_OVR_DIR mce.ini.d)
set(MCE_MODULE_DIR lib/mce/modules)
set(MCE_RUN_DIR /var/run/mce)
set(MCE_VAR_DIR /var/lib/mce)
set(MCE_GCONF_DIR /etc/gconf/schemas/)
set(DBUS_CONF_DIR /etc/dbus-1/system.d)

add_definitions(-D_GNU_SOURCE)
add_definitions(-DMCE_VAR_DIR=${MCE_VAR_DIR})
add_definitions(-DMCE_RUN_DIR=${MCE_RUN_DIR})
add_definitions(-DMCE_CONF_DIR=${MCE_CONF_DIR})
add_definitions(-DMCE_CONF_OVERRIDE_DIR=${MCE_CONF_OVR_DIR})
add_definitions(-DMCE_CONF_FILE=mce.ini)

find_package(PkgConfig REQUIRED)
pkg_search_module(GLIB REQUIRED glib-2.0)
pkg_search_module(GIO REQUIRED gio-2.0)
pkg_search_module(GMODULE REQUIRED gmodule-2.0)
pkg_search_module(DBUS REQUIRED dbus-1)
pkg_search_module(GDBUS REQUIRED dbus-glib-1)
pkg_search_module(SYSTEMUI osso-systemui)
pkg_search_module(CONIC conic)
pkg_search_module(GCONF gconf-2.0)

add_compile_options(
-Wextra
-Wall
-Wpointer-arith
-Wundef
-Wcast-align
-Wshadow
-Wbad-function-cast
-Wwrite-strings
-Wsign-compare
-Wmissing-noreturn
-Wnested-externs
-Wchar-subscripts
-Wmissing-prototypes
-Wformat-security
-Wformat=2
-Wformat-nonliteral
-Winit-self
-Wswitch-default
-Wstrict-prototypes
-Wold-style-definition
-Wmissing-declarations
-Wmissing-include-dirs
-Wstrict-aliasing=2
-Wunsafe-loop-optimizations
-Winvalid-pch
-Waddress
-Wvolatile-register-var
-Wstrict-overflow=5
-Wunreachable-code
-Wstack-protector )

if(NOT DEFINED SYSTEMUI_LIBRARIES)
set(SYSTEMUI_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/dbus-names)
message("Not using system installed systemui dbus names")
endif(NOT DEFINED SYSTEMUI_LIBRARIES)

if(DEFINED CONIC_LIBRARIES)
add_definitions(-DENABLE_CONIC_SUPPORT)
message("Conic support enabled")
else()
message("Conic support disabled")
endif(DEFINED CONIC_LIBRARIES)

set(COMMON_INCLUDE_DIRS
${GLIB_INCLUDE_DIRS}
${GIO_INCLUDE_DIRS}
${GMODULE_INCLUDE_DIRS}
${DBUS_INCLUDE_DIRS}
${GDBUS_INCLUDE_DIRS}
${CONIC_INCLUDE_DIRS}
${SYSTEMUI_INCLUDE_DIRS})

set(COMMON_LIBRARIES
${DBUS_LIBRARIES}
${GLIB_LIBRARIES}
${GIO_LIBRARIES}
${GMODULE_LIBRARIES}
${CONIC_LIBRARIES}
${GDBUS_LIBRARIES})


add_subdirectory(src)
add_subdirectory(src/modules)

if(DEFINED GCONF_LIBRARIES)
message("GConf support enabled")
install(FILES schemas/devicelock.schemas schemas/security.schemas DESTINATION ${MCE_GCONF_DIR})
else()
message("GConf support disabled")
endif(DEFINED GCONF_LIBRARIES)

configure_file(mce.pc.in "${CMAKE_CURRENT_BINARY_DIR}/mce.pc" @ONLY)

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/mce.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(DIRECTORY config/mce.ini.d DESTINATION ${MCE_CONF_DIR})
install(FILES config/mce.ini config/rtconf.ini DESTINATION ${MCE_CONF_DIR})
install(FILES config/mode DESTINATION ${MCE_VAR_DIR})
install(FILES config/mce.conf DESTINATION ${DBUS_CONF_DIR})
install(DIRECTORY src/include/ DESTINATION include FILES_MATCHING PATTERN "*.h")

if(DEFINED SYSTEMUI_LIBRARIES)
message("SystemUI support enabled")
install(FILES config/10-maemo.ini DESTINATION ${MCE_CONF_DIR}/${MCE_CONF_OVR_DIR})
message("SystemUI support enabled")
else()
message("SystemUI support disabled")
endif(DEFINED SYSTEMUI_LIBRARIES)
149 changes: 0 additions & 149 deletions Makefile

This file was deleted.

36 changes: 0 additions & 36 deletions bme-dbus-names.h

This file was deleted.

89 changes: 89 additions & 0 deletions config/10-maemo.ini
@@ -0,0 +1,89 @@
# Configuration file for MCE
# DO NOT EDIT THIS FILE!!
# Copy keys you want to change to mce.ini.d/99-user.ini and edit them there

[Modules]

Modules=rtconf-gconf;lock-tklock;lock-devlock;power-dsme;display;x11-ctrl;inactivity;battery-upower;inactivity-inhibit;filter-brightness-als-iio;alarm

[DevLock]

# Note that the delays loop:
#
# DevLockDelay0 -> DevLockDelay1 -> DevLockDelay2 -> DevLockDelay3 ->
# DevLockDelay0 -> ...

# Delay to use before the user can input the device lock code
#
# Timeout in seconds, default 0 (no delay)
DevLockDelay0=0

# Delay to use 1st time user inputs an incorrect code
#
# Timeout in seconds, default 1
DevLockDelay1=1

# Delay to use 1st time user inputs an incorrect code
#
# Timeout in seconds, default 1
DevLockDelay2=1

# Delay to use 1st time user inputs an incorrect code
#
# Timeout in seconds, default 5
DevLockDelay3=5

# Time before the device shuts down automatically from
# the shutdown query (shown when cancel is pressed in device lock),
# 0 to disable the timeout
#
# Timeout in seconds, default 0 (disable timeout)
DevLockShutdownTimeout=0

[TKLock]

# Blank immediately instead of dim before blank when tklock is enabled
#
# 1 to blank immediately, 0 to dim before blanking
BlankImmediately=1

# Dim immediately instead of having a timeout before dimming
# when tklock is enabled
#
# 1 to dim immediately, 0 to wait for timeout
DimImmediately=1

# Timeout before dimming
#
# Timeout in milliseconds, default 3000
DimDelay=3000

# Policy for touchscreen interrupts
#
# 1 - disable immediately
# 0 - wait until display is blanked
DisableTSImmediately=1

# Policy for keypad interrupts
#
# 2 - leave keypad interrupts on even after blanking
# (used to support pass-through of +/-)
# 1 - disable interrupts immediately
# 0 to wait until display is blanked
DisableKPImmediately=1

# Inhibit autolock when keyboard slide is open
#
# 1 - allow autolock when the keyboard slide is open
# 0 - inhibit autolock when the keyboard slide is open
AutolockWhenSlideOpen=0

# Unlock the tklock if the camera is popped out
#
# 1 to enable, 0 to disable
CameraPopoutUnlock=1

# Unlock the tklock if the lens cover is opened
#
# 1 to enable, 0 to disable
LensCoverUnlock=1
File renamed without changes.