From f72923d2d82ca463bba22e8c97f225f54113ed68 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 3 Sep 2017 17:53:46 +0900 Subject: 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). --- CMakeLists.txt | 16 ++++++++++++++-- 1 file 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") -- cgit v1.2.3