aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt16
1 files changed, 14 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4bf47f71..257c5ee5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -83,9 +83,21 @@ set(libqmatrixclient_SRCS
jobs/logoutjob.cpp
)
-set(example_SRCS examples/qmc-example.cpp)
+if (MATRIX_DOC_PATH AND APIGEN_PATH)
+ add_custom_target(update-api
+ ${APIGEN_PATH} --config jobs/apigen.yaml --out jobs/generated
+ ${MATRIX_DOC_PATH}/api/client-server
+ content-repo.yaml- cas_login_redirect.yaml- cas_login_ticket.yaml-
+ old_sync.yaml- room_initial_sync.yaml-
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+ SOURCES jobs/apigen.yaml jobs/{{base}}.h.mustache jobs/{{base}}.cpp.mustache
+ VERBATIM
+ )
+endif()
-file (STRINGS jobs/generated/apifiles.txt libqmatrixclient_job_SRCS REGEX "\\.cpp$")
+aux_source_directory(jobs/generated libqmatrixclient_job_SRCS)
+
+set(example_SRCS examples/qmc-example.cpp)
add_library(qmatrixclient ${libqmatrixclient_SRCS} ${libqmatrixclient_job_SRCS})
set_property(TARGET qmatrixclient PROPERTY VERSION "0.0.0")