aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-09-03 17:53:46 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-09-03 17:53:46 +0900
commitf72923d2d82ca463bba22e8c97f225f54113ed68 (patch)
tree0bf50930a358e4e40e5d1750e49a57d920c5462a
parent206976c56013067593f006d621fd4f34475d5ce0 (diff)
downloadlibquotient-f72923d2d82ca463bba22e8c97f225f54113ed68.tar.gz
libquotient-f72923d2d82ca463bba22e8c97f225f54113ed68.zip
CMakeLists: add_custom_target(update-api), aux_source_directory to load files list
- cmake --target update-api can be used to update the api files - aux_source_directory() is used to enumerate generated files instead of apifiles.txt (we wouldn't be able to rerun CMake on the changed files list anyway).
-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")