aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-26 07:33:21 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-26 07:33:21 +0200
commitb32fac907b6e61f0f94d28d0e44d77bf0883c8e2 (patch)
treec32ed6a4be5b03d5e5bccd8f7c510cac278a8854 /tests/CMakeLists.txt
parent7f9519e1b54d4e864f2573583945419ef56f8a05 (diff)
parentc7320dab38cb2dda29226eab2c8705b5a132ac87 (diff)
downloadlibayatana-common-b32fac907b6e61f0f94d28d0e44d77bf0883c8e2.tar.gz
libayatana-common-b32fac907b6e61f0f94d28d0e44d77bf0883c8e2.tar.bz2
libayatana-common-b32fac907b6e61f0f94d28d0e44d77bf0883c8e2.zip
Merge branch 'tari01-pr/add-vala-bindings'
Attributes GH PR #35: https://github.com/AyatanaIndicators/libayatana-common/pull/35
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 0349ae6..61ce542 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -32,3 +32,33 @@ target_link_libraries(tst_utils
)
add_test(TstUtils tst_utils)
+
+# utils.h
+
+file(COPY "${CMAKE_SOURCE_DIR}/src/utils.h" DESTINATION "${CMAKE_BINARY_DIR}/src/ayatana/common")
+
+# tst_utils.c
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/tst_utils.c"
+ DEPENDS "src"
+ DEPENDS "gschemas-compiled"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND
+ ${VALA_COMPILER}
+ --pkg AyatanaCommon
+ --pkg gio-2.0
+ --vapidir=${CMAKE_BINARY_DIR}/src
+ --ccode tst_utils.vala
+ --directory=${CMAKE_CURRENT_BINARY_DIR}
+)
+
+# tst_utils_vala
+
+add_executable("tst_utils_vala" "${CMAKE_CURRENT_BINARY_DIR}/tst_utils.c")
+target_include_directories("tst_utils_vala" PUBLIC "${GLIB_INCLUDE_DIRS};${CMAKE_BINARY_DIR}/src")
+target_link_libraries("tst_utils_vala" "${GLIB_LIBRARIES} -layatana-common -L${CMAKE_BINARY_DIR}/src")
+target_link_directories("tst_utils_vala" PUBLIC "${CMAKE_BINARY_DIR}/src")
+add_dependencies("tst_utils_vala" "src")
+
+add_test(NAME "TstUtilsVala" COMMAND "${CMAKE_CURRENT_BINARY_DIR}/tst_utils_vala" "${CMAKE_CURRENT_BINARY_DIR}")