update dependency

This commit is contained in:
Kevin Yue
2021-09-13 23:58:51 +08:00
parent 0eb9cce8bb
commit 14b2f809b8
4 changed files with 84 additions and 30 deletions

View File

@@ -1,3 +1,5 @@
include("${CMAKE_SOURCE_DIR}/cmake/Add3rdParty.cmake")
project(GPService)
set(gpservice_GENERATED_SOURCES)
@@ -20,14 +22,37 @@ add_executable(gpservice
${gpservice_GENERATED_SOURCES}
)
target_include_directories(gpservice PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
add_3rdparty(
SingleApplication
GIT_REPOSITORY https://github.com/itay-grudev/SingleApplication.git
GIT_TAG v3.3.0
EXCLUDE_FROM_ALL
CMAKE_ARGS -DQAPPLICATION_CLASS=QCoreApplication
)
ExternalProject_Get_Property(SingleApplication-${PROJECT_NAME} SOURCE_DIR)
ExternalProject_Get_Property(SingleApplication-${PROJECT_NAME} BINARY_DIR)
set(SingleApplication_INCLUDE_DIR ${SOURCE_DIR})
set(SingleApplication_LIBRARY ${BINARY_DIR}/libSingleApplication.a)
add_dependencies(gpservice SingleApplication-${PROJECT_NAME})
target_include_directories(gpservice PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${SingleApplication_INCLUDE_DIR}
)
target_link_libraries(gpservice
SingleApplication
${SingleApplication_LIBRARY}
Qt5::Core
Qt5::Network
Qt5::DBus
)
target_compile_definitions(gpservice PUBLIC QAPPLICATION_CLASS=QCoreApplication)
install(TARGETS gpservice DESTINATION "/usr/bin")
install(FILES "dbus/com.yuezk.qt.GPService.conf" DESTINATION "/usr/share/dbus-1/system.d" )
install(FILES "dbus/com.yuezk.qt.GPService.service" DESTINATION "/usr/share/dbus-1/system-services")