anotherim-desktop/plugins/windows-notification/CMakeLists.txt

78 lines
3.1 KiB
CMake
Raw Permalink Normal View History

set(GETTEXT_PACKAGE "dino-windows-notifications")
find_package(Gettext)
include(${GETTEXT_USE_FILE})
gettext_compile(${GETTEXT_PACKAGE} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../main/po TARGET_NAME ${GETTEXT_PACKAGE}-translations)
2021-03-26 11:22:55 +00:00
project(windows-notification)
2020-10-24 22:05:35 +00:00
find_packages(WINDOWS_NOTIFICATION_PACKAGES REQUIRED
Gee
GLib
GModule
GObject
2022-08-25 12:29:47 +00:00
GTK4
2020-10-24 22:05:35 +00:00
)
vala_precompile(WINDOWS_NOTIFICATION_VALA_C
SOURCES
2021-02-24 23:26:31 +00:00
src/windows_notifications_plugin.vala
src/windows_notifications_register_plugin.vala
2021-02-27 15:52:03 +00:00
src/toast_notification_builder.vala
src/win_notification_provider.vala
2020-10-24 22:05:35 +00:00
CUSTOM_VAPIS
${CMAKE_BINARY_DIR}/exports/xmpp-vala.vapi
${CMAKE_BINARY_DIR}/exports/dino.vapi
${CMAKE_BINARY_DIR}/exports/qlite.vapi
2021-03-26 11:22:55 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/vapi/win32.vapi
2021-02-18 09:24:53 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/vapi/winrt.vapi
2021-03-26 11:22:55 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/vapi/shortcutcreator.vapi
2021-02-18 09:24:53 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/vapi/enums.vapi
${CMAKE_CURRENT_SOURCE_DIR}/vapi/winrt_windows_ui_notifications.vapi
2020-10-24 22:05:35 +00:00
PACKAGES
${WINDOWS_NOTIFICATION_PACKAGES}
)
2021-03-26 11:22:55 +00:00
set(WINDOWS_API_SOURCES
2021-03-26 11:10:58 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/api/src/gobject/winrt-enums.cpp
${CMAKE_CURRENT_SOURCE_DIR}/api/src/gobject/winrt-event-token.cpp
${CMAKE_CURRENT_SOURCE_DIR}/api/src/gobject/winrt-toast-notification.cpp
${CMAKE_CURRENT_SOURCE_DIR}/api/src/gobject/winrt-toast-notifier.cpp
${CMAKE_CURRENT_SOURCE_DIR}/api/src/gobject/winrt.cpp
2021-03-26 11:22:55 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/api/src/win32.cpp
${CMAKE_CURRENT_SOURCE_DIR}/api/src/converter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/api/src/dyn_mod.cpp
2021-03-07 11:21:27 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/api/src/ginvoke.cpp
2021-03-26 11:22:55 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/api/src/shortcutcreator.cpp
)
add_definitions(${VALA_CFLAGS} -DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DLOCALE_INSTALL_DIR=\"${LOCALE_INSTALL_DIR}\")
2021-03-26 11:22:55 +00:00
add_library(windows-notification SHARED ${WINDOWS_NOTIFICATION_VALA_C} ${WINDOWS_API_SOURCES})
add_dependencies(windows-notification ${GETTEXT_PACKAGE}-translations)
2020-11-25 21:55:33 +00:00
2021-03-26 11:22:55 +00:00
target_include_directories(windows-notification
PRIVATE
${PROJECT_SOURCE_DIR}/api/include
${PROJECT_SOURCE_DIR}/api/include/gobject
2021-02-18 09:24:53 +00:00
${PROJECT_SOURCE_DIR}/yolort/include
2020-11-25 21:55:33 +00:00
)
2021-03-26 11:22:55 +00:00
find_library(shlwapi_LIBRARY shlwapi libshlwapi libshlwapi.a HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if(NOT shlwapi_LIBRARY)
message(FATAL_ERROR "shlwapi library not found")
endif(NOT shlwapi_LIBRARY)
find_library(ntdll_LIBRARY ntdll libntdll libntdll.a HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if(NOT ntdll_LIBRARY)
message(FATAL_ERROR "ntdll library not found")
endif(NOT ntdll_LIBRARY)
2021-06-19 11:13:39 +00:00
target_link_libraries(windows-notification libdino ${shlwapi_LIBRARY} ${ntdll_LIBRARY} ${WINDOWS_NOTIFICATION_PACKAGES})
2021-10-23 00:45:52 +00:00
target_compile_features(windows-notification PRIVATE cxx_std_17)
target_compile_definitions(windows-notification PRIVATE WINRT_GLIB_H_INSIDE)
target_compile_options(windows-notification PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-iquote ${PROJECT_SOURCE_DIR}/yolort/include/winrt/yolort_impl>)
2020-11-20 11:58:53 +00:00
2020-10-24 22:05:35 +00:00
set_target_properties(windows-notification PROPERTIES PREFIX "")
set_target_properties(windows-notification PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins/)
install(TARGETS windows-notification ${PLUGIN_INSTALL})