-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Description
Description
The generated CMakeLists.txt for the cpp-qt client uses the variable ${HEADER_FILES} in an install() command, but HEADER_FILES is never defined or populated anywhere in the file. This results in the install command being a no-op or potentially causing errors on some CMake invocations.
Relevant lines:
install(
FILES ${HEADER_FILES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
)No line in the generated file (or the cpp-qt-client/CMakeLists.txt.mustache template) sets or populates HEADER_FILES.
By contrast, other generators (like cpp-restsdk) define this variable using file(GLOB_RECURSE HEADER_FILES ...).
openapi-generator version
7.20.0
OpenAPI declaration file content or url
https://github.com/OpenAPITools/openapi-generator/tree/master/samples/client/petstore/cpp-qt/client
Generation Details
openapi-generator generate --global-property skipFormModel=false -g cpp-qt-client -i myyaml.yml -o generated/
Steps to reproduce
- Generate a client for CPP-QT (e.g., with the petstore sample or other spec).
- Inspect the resulting
CMakeLists.txt.
Expected vs Actual
Expected: HEADER_FILES should be defined or populated with the headers to be installed.
Actual: HEADER_FILES is undefined.
Suggest a fix
Add a line to globally define HEADER_FILES (for example, using file(GLOB_RECURSE HEADER_FILES "*.h") or enumerating the headers).
Code reference for context:
Example of correct usage in cpp-restsdk:
file(GLOB_RECURSE HEADER_FILES "include/*.h")
file(GLOB_RECURSE SOURCE_FILES "src/*.cpp")
add_library(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES})This ensures all header files are collected and can be installed as needed.