mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
Migrate to cmake and refine the code structure (#92)
* migrate to cmake * move the 3rd party libs * organize 3rdparty * update the 3rd party version * refine the CMakeLists.txt * update install command * update install command * update install command * update install command * update dependency * update the dependency * update the dependency * remove CPM.cmake * remove QtCreator project file * update cmake file * improve cmake file * add cmakew * use wget * remove echo * update the doc * remove the screenshot * update the doc * update the install steps * check the openconnect version * update the doc * update install scripts * fix install scripts * improve message * improve message * improve install scripts * improve the version check * improve the version check * improve install script * add version * organize includes * add version bump * update CI * update CI * add the release flag * update message
This commit is contained in:
57
GPService/CMakeLists.txt
Normal file
57
GPService/CMakeLists.txt
Normal file
@@ -0,0 +1,57 @@
|
||||
include("${CMAKE_SOURCE_DIR}/cmake/Add3rdParty.cmake")
|
||||
|
||||
project(GPService)
|
||||
|
||||
set(gpservice_GENERATED_SOURCES)
|
||||
|
||||
# generate the dbus xml definition
|
||||
qt5_generate_dbus_interface(gpservice.h ${CMAKE_BINARY_DIR}/com.yuezk.qt.GPService.xml)
|
||||
|
||||
# generate dbus adaptor
|
||||
qt5_add_dbus_adaptor(
|
||||
gpservice_GENERATED_SOURCES
|
||||
${CMAKE_BINARY_DIR}/com.yuezk.qt.GPService.xml
|
||||
gpservice.h
|
||||
GPService
|
||||
)
|
||||
|
||||
add_executable(gpservice
|
||||
gpservice.cpp
|
||||
main.cpp
|
||||
sigwatch.cpp
|
||||
${gpservice_GENERATED_SOURCES}
|
||||
)
|
||||
|
||||
add_3rdparty(
|
||||
SingleApplication
|
||||
GIT_REPOSITORY https://github.com/itay-grudev/SingleApplication.git
|
||||
GIT_TAG v3.3.0
|
||||
CMAKE_ARGS -DQAPPLICATION_CLASS=QCoreApplication
|
||||
)
|
||||
|
||||
ExternalProject_Get_Property(SingleApplication-${PROJECT_NAME} SOURCE_DIR 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_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")
|
||||
install(FILES "systemd/gpservice.service" DESTINATION "/etc/systemd/system")
|
Reference in New Issue
Block a user