aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-05-05 19:36:15 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-05-05 19:36:15 +0900
commita8d2a73c771f188fc0fdc6351b4923af788317d5 (patch)
treeb2795b93149f7c0ae3cd5005331b650a8eb6fd1e /CMakeLists.txt
parentda16225dfbec9b155c2c299757203f7676ac6ccf (diff)
parenta63838235134b066c092ad98e1f18ff7991c91c1 (diff)
downloadlibquotient-a8d2a73c771f188fc0fdc6351b4923af788317d5.tar.gz
libquotient-a8d2a73c771f188fc0fdc6351b4923af788317d5.zip
Merge branch 'kitsune-gtad'
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt38
1 files changed, 33 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 93cb16fd..935ba3dc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,6 +52,11 @@ if (CMAKE_BUILD_TYPE)
endif(CMAKE_BUILD_TYPE)
message( STATUS "Using compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" )
message( STATUS "Using Qt ${Qt5_VERSION} at ${Qt5_Prefix}" )
+if (MATRIX_DOC_PATH AND GTAD_PATH)
+ message( STATUS "Generating API stubs enabled" )
+ message( STATUS " Using GTAD at ${GTAD_PATH}" )
+ message( STATUS " Using CS API files at ${MATRIX_DOC_PATH}/api/client-server" )
+endif ()
message( STATUS "=============================================================================" )
message( STATUS )
@@ -78,19 +83,42 @@ set(libqmatrixclient_SRCS
lib/jobs/basejob.cpp
lib/jobs/checkauthmethods.cpp
lib/jobs/sendeventjob.cpp
- lib/jobs/setroomstatejob.cpp
- lib/jobs/joinroomjob.cpp
- lib/jobs/roommessagesjob.cpp
lib/jobs/syncjob.cpp
lib/jobs/mediathumbnailjob.cpp
lib/jobs/downloadfilejob.cpp
)
-aux_source_directory(lib/jobs/generated libqmatrixclient_job_SRCS)
+set(API_DEF_PATH ${MATRIX_DOC_PATH}/api/client-server)
+file(GLOB_RECURSE API_DEFS RELATIVE ${PROJECT_SOURCE_DIR}
+ ${API_DEF_PATH}/*.yaml
+ ${API_DEF_PATH}/definitions/*.yaml
+ ${MATRIX_DOC_PATH}/event-schemas/schema/*
+)
+set(GTAD_CONFIG_DIR lib/csapi)
+set(GEN_SRC_DIR lib/csapi)
+if (MATRIX_DOC_PATH AND GTAD_PATH)
+ add_custom_target(update-api
+ ${GTAD_PATH} --config ${GTAD_CONFIG_DIR}/gtad.yaml --out ${GEN_SRC_DIR}
+ ${API_DEF_PATH}
+ cas_login_redirect.yaml- cas_login_ticket.yaml-
+ old_sync.yaml- room_initial_sync.yaml- # deprecated
+ sync.yaml-
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+ SOURCES ${GTAD_CONFIG_DIR}/gtad.yaml
+ ${GTAD_CONFIG_DIR}/{{base}}.h.mustache
+ ${GTAD_CONFIG_DIR}/{{base}}.cpp.mustache
+ ${API_DEFS}
+ VERBATIM
+ )
+endif()
+
+aux_source_directory(${GEN_SRC_DIR} libqmatrixclient_job_SRCS)
+aux_source_directory(${GEN_SRC_DIR}/definitions libqmatrixclient_def_SRCS)
set(example_SRCS examples/qmc-example.cpp)
-add_library(QMatrixClient ${libqmatrixclient_SRCS} ${libqmatrixclient_job_SRCS})
+add_library(QMatrixClient ${libqmatrixclient_SRCS}
+ ${libqmatrixclient_job_SRCS} ${libqmatrixclient_def_SRCS})
set(API_VERSION "0.2")
set_property(TARGET QMatrixClient PROPERTY VERSION "${API_VERSION}.0")
set_property(TARGET QMatrixClient PROPERTY SOVERSION 0 )