aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt26
1 files changed, 18 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d930bbf2..555ffa96 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -174,16 +174,26 @@ set(FULL_CSAPI_DIR lib/${CSAPI_DIR})
set(ASAPI_DEF_DIR application-service/definitions)
set(ISAPI_DEF_DIR identity/definitions)
-if (GTAD_PATH)
+if (GTAD_PATH AND MATRIX_DOC_PATH)
get_filename_component(ABS_GTAD_PATH "${GTAD_PATH}" REALPATH)
+ if (EXISTS ${ABS_GTAD_PATH})
+ get_filename_component(ABS_API_DEF_PATH "${MATRIX_DOC_PATH}/data/api" REALPATH)
+ if (NOT IS_DIRECTORY ${ABS_API_DEF_PATH})
+ # Check the old place of API files
+ get_filename_component(ABS_API_DEF_PATH "${MATRIX_DOC_PATH}/api" REALPATH)
+ endif ()
+ if (IS_DIRECTORY ${ABS_API_DEF_PATH})
+ set(API_GENERATION_ENABLED 1)
+ else ()
+ message( WARNING "${MATRIX_DOC_PATH} doesn't seem to point to a valid matrix-doc repo; disabling API stubs generation")
+ endif ()
+ else (EXISTS ${ABS_GTAD_PATH})
+ message( WARNING "${GTAD_PATH} doesn't exist; disabling API stubs generation")
+ endif ()
endif ()
-if (MATRIX_DOC_PATH)
- get_filename_component(ABS_API_DEF_PATH "${MATRIX_DOC_PATH}/api" REALPATH)
-endif ()
-if (ABS_GTAD_PATH AND ABS_API_DEF_PATH)
+if (API_GENERATION_ENABLED)
message( STATUS "Using GTAD at ${ABS_GTAD_PATH}" )
- message( STATUS "Using API files at ${ABS_API_DEF_PATH}" )
- set(API_GENERATION_ENABLED 1)
+ message( STATUS "Found API files at ${ABS_API_DEF_PATH}" )
if (NOT CLANG_FORMAT)
set(CLANG_FORMAT clang-format)
endif()
@@ -225,7 +235,7 @@ if (ABS_GTAD_PATH AND ABS_API_DEF_PATH)
VERBATIM
)
add_custom_target(update-api DEPENDS generate-unformatted-api)
- if (ABS_CLANG_FORMAT)
+ if (EXISTS ${ABS_CLANG_FORMAT})
set(CLANG_FORMAT_ARGS -i -sort-includes ${CLANG_FORMAT_ARGS})
# FIXME: the list of files should be produced after GTAD has run.
# For now it's produced at CMake invocation. If file() hasn't found