Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'cmake' into 'master'
Fix CMake issues

See merge request mer-core/mapplauncherd!17
  • Loading branch information
Tomin1 committed May 28, 2021
2 parents 15f235f + 75aafaf commit 254e3d1
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
16 changes: 12 additions & 4 deletions CMakeLists.txt
Expand Up @@ -3,6 +3,11 @@ project(Applauncherd)
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)

include(FeatureSummary)
include(GNUInstallDirs)

option(INSTALL_SYSTEMD_UNITS "Install systemd unit files" ON)

#
# NOTE: For verbose build use VERBOSE=1
#
Expand Down Expand Up @@ -47,12 +52,15 @@ add_subdirectory(src)
# Target for documentation (make doc)
find_program(Doxygen NAMES doxygen)
if (EXISTS ${Doxygen})
add_custom_target(doc COMMAND cd doc && ${Doxygen} doxygen-impldoc.conf COMMAND cd doc && ${Doxygen} doxygen-userdoc.conf COMMAND cd doc && ${Doxygen} doxygen-mdeclarativecache.conf)
add_custom_target(doc
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR}/doc && ${Doxygen} doxygen-impldoc.conf
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR}/doc && ${Doxygen} doxygen-userdoc.conf
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR}/doc && ${Doxygen} doxygen-mdeclarativecache.conf)
else (EXISTS ${Doxygen})
message(STATUS "Doxygen not found: you're not able to build documentation.")
endif (EXISTS ${Doxygen})

# Install html documentation
install(DIRECTORY doc/implementation-documentation DESTINATION /usr/share/doc/applauncherd OPTIONAL)
install(DIRECTORY doc/user-documentation DESTINATION /usr/share/doc/applauncherd OPTIONAL)
install(DIRECTORY doc/mdeclarativecache-documentation DESTINATION /usr/share/doc/applauncherd OPTIONAL)
install(DIRECTORY doc/implementation-documentation DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR} OPTIONAL)
install(DIRECTORY doc/user-documentation DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR} OPTIONAL)
install(DIRECTORY doc/mdeclarativecache-documentation DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR} OPTIONAL)
7 changes: 5 additions & 2 deletions src/booster-generic/CMakeLists.txt
Expand Up @@ -17,5 +17,8 @@ add_executable(booster-generic ${SRC} ${MOC_SRC})
add_dependencies(booster-generic applauncherd)

# Add install rule
install(TARGETS booster-generic DESTINATION /usr/libexec/mapplauncherd/)
install(FILES booster-generic.service DESTINATION /usr/lib/systemd/user/)
install(TARGETS booster-generic DESTINATION ${CMAKE_INSTALL_FULL_LIBEXECDIR}/mapplauncherd/)

if(INSTALL_SYSTEMD_UNITS)
install(FILES booster-generic.service DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/user/)
endif()
4 changes: 1 addition & 3 deletions src/invoker/CMakeLists.txt
Expand Up @@ -19,6 +19,4 @@ add_executable(invoker ${SRC})
target_link_libraries(invoker ${DBUS_LDFLAGS})

# Add install rule
install(PROGRAMS invoker DESTINATION /usr/bin/)


install(TARGETS invoker DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
14 changes: 11 additions & 3 deletions src/launcherlib/CMakeLists.txt
Expand Up @@ -2,7 +2,12 @@ include(GNUInstallDirs)

set(COMMON ${CMAKE_HOME_DIRECTORY}/src/common)

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${COMMON})
# Find systemd
find_package(PkgConfig REQUIRED)
pkg_check_modules(SYSTEMD "libsystemd" REQUIRED)

# Set include dirs
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${SYSTEMD_INCLUDE_DIRS} ${COMMON})

# Hide all symbols except the ones explicitly exported in the code (like main())
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
Expand All @@ -16,13 +21,16 @@ set(HEADERS appdata.h booster.h connection.h daemon.h logger.h launcherlib.h

# Set libraries to be linked. Shared libraries to be preloaded are not linked in anymore,
# but dlopen():ed and listed in src/launcher/preload.h instead.
link_libraries(${LIBDL} "-L/lib -lsystemd -lcap")
link_libraries(${LIBDL} "-L/lib -lcap")

# Set executable
add_library(applauncherd MODULE ${SRC} ${MOC_SRC})
set_target_properties(applauncherd PROPERTIES VERSION 0.1 SOVERSION 0)

target_link_libraries(applauncherd ${SYSTEMD_LIBRARIES})


# Add install rule
install(TARGETS applauncherd DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
install(FILES ${HEADERS} DESTINATION /usr/include/applauncherd
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/applauncherd
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
2 changes: 1 addition & 1 deletion src/single-instance/CMakeLists.txt
Expand Up @@ -26,4 +26,4 @@ link_libraries(${DBUS_LDFLAGS})
add_executable(single-instance ${SRC})

# Add install rule
install(PROGRAMS single-instance DESTINATION /usr/bin/)
install(TARGETS single-instance DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})

0 comments on commit 254e3d1

Please sign in to comment.