mirror of https://github.com/cutefishos/appmotor
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
798 B
CMake
30 lines
798 B
CMake
set(COMMON "${CMAKE_HOME_DIRECTORY}/src/common")
|
|
|
|
# Set sources
|
|
set(SRC main.cpp ${COMMON}/report.c)
|
|
|
|
# Find dbus
|
|
include(FindPkgConfig)
|
|
pkg_check_modules(DBUS dbus-1 REQUIRED)
|
|
|
|
# Set include dirs
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${DBUS_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 -fPIC")
|
|
|
|
# Link as position independent executable
|
|
set(CMAKE_EXE_LINKER_FLAGS "-pie -rdynamic")
|
|
|
|
# Set C flags because of report.c
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fPIC")
|
|
|
|
# Set link libraries
|
|
link_libraries(${DBUS_LDFLAGS})
|
|
|
|
# Set target
|
|
add_executable(single-instance ${SRC})
|
|
|
|
# Add install rule
|
|
install(PROGRAMS single-instance DESTINATION /usr/bin/)
|