Stop regenerating openapitools.json in multiple folders

This commit is contained in:
2026-06-11 19:41:49 -04:00
parent f2aa8d5c15
commit e87c0fe8ec
4 changed files with 23 additions and 9 deletions
+2 -6
View File
@@ -1,7 +1,6 @@
include_guard(GLOBAL)
include("${CMAKE_CURRENT_LIST_DIR}/dbGenerationCommon.cmake")
set(_CPPBESSOT_DB_GEN_CPP_DIR "${CMAKE_CURRENT_LIST_DIR}")
function(cppbessot_add_db_gen_cpp_target schema_dir)
# Purpose: Register C++ model generation target using checked-in templates.
@@ -13,11 +12,7 @@ function(cppbessot_add_db_gen_cpp_target schema_dir)
# - Files under `<schema_dir>/generated-cpp-source`.
cppbessot_validate_schema_dir_name("${schema_dir}")
cppbessot_get_schema_dir_path(_version_dir "${schema_dir}")
if(DEFINED CPPBESSOT_MODULE_ROOT AND NOT "${CPPBESSOT_MODULE_ROOT}" STREQUAL "")
set(_module_root "${CPPBESSOT_MODULE_ROOT}")
else()
get_filename_component(_module_root "${_CPPBESSOT_DB_GEN_CPP_DIR}/.." ABSOLUTE)
endif()
cppbessot_get_module_root(_module_root)
set(_openapi_file "${_version_dir}/openapi/openapi.yaml")
set(_template_dir "${_module_root}/openapi/templates/cpp-odb-json")
@@ -40,6 +35,7 @@ function(cppbessot_add_db_gen_cpp_target schema_dir)
-o "${_output_dir}"
--global-property models
DEPENDS "${_openapi_file}" ${_template_inputs}
WORKING_DIRECTORY "${_module_root}"
COMMENT "Generating C++ model headers/sources for ${schema_dir}"
VERBATIM
)