mirror of
https://github.com/latentPrion/cppbessot.git
synced 2026-06-23 15:18:37 +00:00
Fix dependencies and commands to not regen on each source touch
This commit is contained in:
@@ -24,8 +24,13 @@ function(cppbessot_add_db_gen_cpp_target schema_dir)
|
||||
set(_template_config "${_template_dir}/config.yaml")
|
||||
set(_output_dir "${_version_dir}/generated-cpp-source")
|
||||
file(GLOB_RECURSE _template_inputs CONFIGURE_DEPENDS "${_template_dir}/*")
|
||||
cppbessot_get_expected_cpp_model_outputs(
|
||||
_expected_model_headers
|
||||
_expected_model_sources
|
||||
"${schema_dir}")
|
||||
|
||||
add_custom_target(db_gen_cpp_headers
|
||||
add_custom_command(
|
||||
OUTPUT ${_expected_model_headers} ${_expected_model_sources}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${_output_dir}"
|
||||
COMMAND "${CPPBESSOT_NPX_EXECUTABLE}" @openapitools/openapi-generator-cli generate
|
||||
-i "${_openapi_file}"
|
||||
@@ -39,5 +44,8 @@ function(cppbessot_add_db_gen_cpp_target schema_dir)
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_target(db_gen_cpp_headers
|
||||
DEPENDS ${_expected_model_headers} ${_expected_model_sources})
|
||||
|
||||
set_target_properties(db_gen_cpp_headers PROPERTIES EXCLUDE_FROM_ALL TRUE)
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user