aboutsummaryrefslogtreecommitdiff
path: root/bindings/mono/examples
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-06-10 22:01:16 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-06-10 22:01:16 +0200
commit80245fc04e09148863c493af860a6b2710909888 (patch)
treeb12c83377af5017dcb2aa63cfc760209c279dc4e /bindings/mono/examples
parent31484851efadc92f86fb117dcf9b6c81b053de10 (diff)
parentfd8225ec3949f2e94ea8278563c7fdbe427617c7 (diff)
downloadlibayatana-appindicator-80245fc04e09148863c493af860a6b2710909888.tar.gz
libayatana-appindicator-80245fc04e09148863c493af860a6b2710909888.tar.bz2
libayatana-appindicator-80245fc04e09148863c493af860a6b2710909888.zip
Merge branch 'tari01-pr/move-to-cmake'
Attributes GH PR #16: https://github.com/AyatanaIndicators/libayatana-appindicator/pull/16
Diffstat (limited to 'bindings/mono/examples')
-rw-r--r--bindings/mono/examples/CMakeLists.txt20
-rw-r--r--bindings/mono/examples/Makefile.am13
-rwxr-xr-xbindings/mono/examples/ayatana-indicator-example.in2
3 files changed, 21 insertions, 14 deletions
diff --git a/bindings/mono/examples/CMakeLists.txt b/bindings/mono/examples/CMakeLists.txt
new file mode 100644
index 0000000..431a654
--- /dev/null
+++ b/bindings/mono/examples/CMakeLists.txt
@@ -0,0 +1,20 @@
+# ayatana-indicator-example
+
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicator-example.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-example" @ONLY)
+
+# AyatanaIndicatorExample.exe
+
+find_program(MONO mono)
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIndicatorExample.exe"
+ DEPENDS "bindings-mono"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND
+ ${MCS}
+ -out:"${CMAKE_CURRENT_BINARY_DIR}/AyatanaIndicatorExample.exe"
+ -target:exe
+ ${GTK_SHARP_3_0_LDFLAGS} "-r:${CMAKE_BINARY_DIR}/bindings/mono/ayatana-appindicator-sharp.dll" "${CMAKE_CURRENT_SOURCE_DIR}/AyatanaIndicatorExample.cs"
+)
+
+add_custom_target("bindings-mono-examples" ALL DEPENDS "AyatanaIndicatorExample.exe")
diff --git a/bindings/mono/examples/Makefile.am b/bindings/mono/examples/Makefile.am
deleted file mode 100644
index de93b20..0000000
--- a/bindings/mono/examples/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-ASSEMBLY = AyatanaIndicatorExample.exe
-CSFILES = AyatanaIndicatorExample.cs
-CLEANFILES = $(ASSEMBLY)
-DISTCLEANFILES = Makefile.in
-
-EXTRA_DIST = $(CSFILES)
-
-references = $(GTK_SHARP_LIBS) -r:$(top_builddir)/bindings/mono/ayatana-appindicator-sharp.dll
-
-$(ASSEMBLY): $(CSFILES) Makefile.am
- $(CSC) $(CSFLAGS) -out:$(ASSEMBLY) -target:exe $(references) $(srcdir)/$(CSFILES)
-
-all: $(ASSEMBLY)
diff --git a/bindings/mono/examples/ayatana-indicator-example.in b/bindings/mono/examples/ayatana-indicator-example.in
index 07d1473..3f63b3d 100755
--- a/bindings/mono/examples/ayatana-indicator-example.in
+++ b/bindings/mono/examples/ayatana-indicator-example.in
@@ -1,2 +1,2 @@
#!/bin/sh
-MONO_PATH=@top_builddir@/bindings/mono @top_builddir@/bindings/mono/examples/AyatanaIndicatorExample.exe
+MONO_PATH=@CMAKE_BINARY_DIR@/bindings/mono @CMAKE_CURRENT_BINARY_DIR@/AyatanaIndicatorExample.exe