瀏覽代碼

Make folder-based generation optional for single-file generator

- Add FOLDER option for qtprotobufgen and qtprotobuf_generate cmake
  routine
- Make external dependencies folder-based only
- Cleanup cmake messaging
- Update tests, examples, README

Fixes: #40
Alexey Edelev 5 年之前
父節點
當前提交
89cdb5465a

+ 5 - 5
CMakeLists.txt

@@ -20,7 +20,7 @@ if(Qt5Core_VERSION VERSION_LESS "5.12.3")
 endif()
 
 if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/grpc/CMakeLists.txt")
-    message(STATUS "-- Found local gRPC sources directory. Perform all-in-one build")
+    message(STATUS "Found local gRPC sources directory. Perform all-in-one build")
     set(gRPC_BUILD_TESTS FALSE)
     set(protobuf_BUILD_TESTS FALSE)
     add_subdirectory("3rdparty/grpc" EXCLUDE_FROM_ALL)
@@ -87,7 +87,7 @@ if(NOT DOXYGEN_FOUND)
     find_program(DOXYGEN_EXECUTABLE doxygen)
 endif()
 if(DEFINED DOXYGEN_EXECUTABLE)
-    message(STATUS "-- Using doxygen to generate documenation: ${DOXYGEN_EXECUTABLE}")
+    message(STATUS "Using doxygen to generate documenation: ${DOXYGEN_EXECUTABLE}")
     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen/customdoxygen.css ${CMAKE_CURRENT_BINARY_DIR}/customdoxygen.css COPYONLY)
     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen/header.html ${CMAKE_CURRENT_BINARY_DIR}/header.html COPYONLY)
@@ -114,9 +114,9 @@ endif()
 
 if(NOT gRPC_FOUND)
     message(WARNING "gRPC not found: some tests and examples cannot be built.")
-    message(STATUS "-- Force disable test")
+    message(STATUS "Force disable test")
     set(QT_PROTOBUF_MAKE_TESTS OFF)
-    message(STATUS "-- Force disable examples")
+    message(STATUS "Force disable examples")
     set(QT_PROTOBUF_MAKE_EXAMPLES OFF)
 endif()
 
@@ -135,7 +135,7 @@ if(QT_PROTOBUF_MAKE_TESTS)
         enable_testing()
         add_subdirectory("tests")
     else()
-        message(STATUS "-- Force disable test")
+        message(STATUS "Force disable test")
     endif()
 endif()
 

+ 8 - 2
README.md

@@ -124,7 +124,7 @@ cmake --build . [--config <RELEASE|DEBUG>] -- /m:<N>
 ## Direct usage of generator
 
 ```bash
-[QT_PROTOBUF_OPTIONS="[SINGLE|MULTI]:QML:COMMENTS"] protoc --plugin=protoc-gen-qtprotobuf=<path/to/bin/>qtprotobufgen --qtprotobuf_out=<output_dir> [-I/extra/proto/include/path] <protofile>.proto
+[QT_PROTOBUF_OPTIONS="[SINGLE|MULTI]:QML:COMMENTS:FOLDER"] protoc --plugin=protoc-gen-qtprotobuf=<path/to/bin/>qtprotobufgen --qtprotobuf_out=<output_dir> [-I/extra/proto/include/path] <protofile>.proto
 ```
 
 ### QT_PROTOBUF_OPTIONS
@@ -132,7 +132,7 @@ cmake --build . [--config <RELEASE|DEBUG>] -- /m:<N>
 For protoc command you also may specify extra options using QT_PROTOBUF_OPTIONS environment variable and colon-separated format:
 
 ``` bash
-[QT_PROTOBUF_OPTIONS="[SINGLE|MULTI]:QML:COMMENTS"] protoc --plugin=protoc-gen-qtprotobuf=<path/to/bin/>qtprotobufgen --qtprotobuf_out=<output_dir> [-I/extra/proto/include/path] <protofile>.proto
+[QT_PROTOBUF_OPTIONS="[SINGLE|MULTI]:QML:COMMENTS:FOLDER"] protoc --plugin=protoc-gen-qtprotobuf=<path/to/bin/>qtprotobufgen --qtprotobuf_out=<output_dir> [-I/extra/proto/include/path] <protofile>.proto
 ```
 
 Following options are supported:
@@ -149,6 +149,8 @@ Following options are supported:
 
 *COMMENTS* - enables comments copying from .proto files
 
+*FOLDER* - enables folder-based generation
+
 ## Integration with CMake project
 
 You can integrate QtProtobuf as submodule in your project or as installed in system package. Add following line in your project CMakeLists.txt:
@@ -215,6 +217,10 @@ qtprotobuf_generate is cmake helper function that automatically generates STATIC
 
 *COMMENTS* - Enables comments copying from .proto files. If provided in parameter list message and field related comments will be copied to generated header files.
 
+*FOLDER* - Enables folder based generation. If provided in parameter list generator will place generated artifacts to folder structure according to package of corresponding .proto file
+
+>**Note:** enabled by default if MULTI option provided
+
 #### qtprotobuf_link_archive
 
 qtprotobuf_link_archive is cmake helper function that links whole archive to your library or executable target. It's useful when you try to link generated target to shared library or/and to executable that doesn't utilize all protobuf generated classes directly from C++ code, but requires them from QML.

+ 1 - 1
cmake/Coverage.cmake

@@ -5,7 +5,7 @@ elseif(NOT DEFINED QT_PROTOBUF_MAKE_COVERAGE)
 endif()
 
 if(QT_PROTOBUF_MAKE_COVERAGE AND UNIX)
-    message(STATUS "-- Enable gcov")
+    message(STATUS "Enable gcov")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage")
 endif()

+ 1 - 1
cmake/GenerateQtHeaders.cmake

@@ -9,7 +9,7 @@ function(protobuf_generate_qt_headers)
         file(STRINGS ${PUBLIC_HEADER} CLASS_NAME REGEX "#pragma once //[a-zA-Z]+")
         if (NOT "${CLASS_NAME}" STREQUAL "")
             string(REPLACE "#pragma once //" "" CLASS_NAME "${CLASS_NAME}")
-            message("-- Generate Qt header for ${CLASS_NAME}")
+            message(STATUS "Generate Qt header for ${CLASS_NAME}")
             configure_file("${QT_PROTOBUF_CMAKE_DIR}/GeneratedHeaderTemplate" "${QT_PROTOBUF_BINARY_DIR}/include/${protobuf_generate_qt_headers_COMPONENT}/${CLASS_NAME}" @ONLY)
             set(GENERATED_PUBLIC_HEADER ${GENERATED_PUBLIC_HEADER} ${QT_PROTOBUF_BINARY_DIR}/include/${protobuf_generate_qt_headers_COMPONENT}/${CLASS_NAME})
         endif()

+ 18 - 4
cmake/QtProtobufGen.cmake

@@ -17,7 +17,7 @@ function(qtprotobuf_link_archive TARGET GENERATED_TARGET)
 endfunction()
 
 function(qtprotobuf_generate)
-    set(options MULTI QML COMMENTS)
+    set(options MULTI QML COMMENTS FOLDER)
     set(oneValueArgs OUT_DIR TARGET GENERATED_TARGET)
     set(multiValueArgs GENERATED_HEADERS EXCLUDE_HEADERS PROTO_FILES PROTO_INCLUDES)
     cmake_parse_arguments(qtprotobuf_generate "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@@ -40,6 +40,8 @@ function(qtprotobuf_generate)
     set(GENERATION_TYPE "SIGNLE")
     if(qtprotobuf_generate_MULTI)
         set(GENERATION_TYPE "MULTI")
+        set(qtprotobuf_generate_FOLDER TRUE)
+        message(STATUS "Multi-file generation is set. Folder-based generation enabled automatically for ${GENERATED_TARGET_NAME}")
     endif()
     set(GENERATION_OPTIONS ${GENERATION_TYPE})
 
@@ -53,6 +55,13 @@ function(qtprotobuf_generate)
         set(GENERATION_OPTIONS "${GENERATION_OPTIONS}:COMMENTS")
     endif()
 
+    if(qtprotobuf_generate_FOLDER)
+        message(STATUS "Enabled FOLDER generation for ${GENERATED_TARGET_NAME}")
+        set(GENERATION_OPTIONS "${GENERATION_OPTIONS}:FOLDER")
+        set(FOLDER_ENABLED "FOLDER")
+    endif()
+
+
     if(WIN32)
         set(PROTOC_COMMAND set QT_PROTOBUF_OPTIONS=${GENERATION_OPTIONS}&& $<TARGET_FILE:protobuf::protoc>)
     else()
@@ -72,7 +81,7 @@ function(qtprotobuf_generate)
         foreach(PROTO_FILE IN LISTS qtprotobuf_generate_PROTO_FILES)
             get_filename_component(BASE_DIR ${PROTO_FILE} DIRECTORY)
             set(PROTO_INCLUDES -I"${BASE_DIR}" ${PROTO_INCLUDES})
-            execute_process(COMMAND ${GO_EXECUTABLE} run ${PROTO_PARSER} ${PROTO_FILE} ${GENERATION_TYPE} OUTPUT_VARIABLE GENERATED_HEADERS_PART ERROR_VARIABLE PARSER_ERROR)
+            execute_process(COMMAND ${GO_EXECUTABLE} run ${PROTO_PARSER} ${PROTO_FILE} ${GENERATION_TYPE} ${FOLDER_ENABLED} OUTPUT_VARIABLE GENERATED_HEADERS_PART ERROR_VARIABLE PARSER_ERROR)
             set(GENERATED_HEADERS ${GENERATED_HEADERS} ${GENERATED_HEADERS_PART})
         endforeach()
     endif()
@@ -107,8 +116,13 @@ function(qtprotobuf_generate)
         get_filename_component(GENERATED_BASENAME ${GENERATED_HEADER} NAME)
         string(REGEX REPLACE "\\.[^.]*$" "" GENERATED_BASENAME ${GENERATED_BASENAME})
 
-        list(APPEND GENERATED_SOURCES_FULL ${OUT_DIR}/${GENERATED_DIRECTORY}/${GENERATED_BASENAME}.cpp)
-        list(APPEND GENERATED_HEADERS_FULL ${OUT_DIR}/${GENERATED_DIRECTORY}/${GENERATED_BASENAME}.h)
+        if(qtprotobuf_generate_FOLDER)
+            list(APPEND GENERATED_SOURCES_FULL ${OUT_DIR}/${GENERATED_DIRECTORY}/${GENERATED_BASENAME}.cpp)
+            list(APPEND GENERATED_HEADERS_FULL ${OUT_DIR}/${GENERATED_DIRECTORY}/${GENERATED_BASENAME}.h)
+        else()
+            list(APPEND GENERATED_SOURCES_FULL ${OUT_DIR}/${GENERATED_BASENAME}.cpp)
+            list(APPEND GENERATED_HEADERS_FULL ${OUT_DIR}/${GENERATED_BASENAME}.h)
+        endif()
         set_property(SOURCE ${OUT_DIR}/${GENERATED_DIRECTORY}/${GENERATED_BASENAME}.cpp PROPERTY SKIP_AUTOMOC ON)
     endforeach()
 

+ 2 - 2
examples/addressbook/addressbookengine.cpp

@@ -25,8 +25,8 @@
 
 #include "addressbookengine.h"
 
-#include "qtprotobuf/examples/addressbook.qpb.h"
-#include "qtprotobuf/examples/addressbook_grpc.qpb.h"
+#include "addressbook.qpb.h"
+#include "addressbook_grpc.qpb.h"
 
 #include <QGrpcHttp2Channel>
 #include <QGrpcUserPasswordCredentials>

+ 1 - 1
examples/addressbook/addressbookengine.h

@@ -26,7 +26,7 @@
 #pragma once
 
 #include <QObject>
-#include "qtprotobuf/examples/addressbook.qpb.h"
+#include "addressbook.qpb.h"
 
 #include "universallistmodel.h"
 

+ 1 - 1
examples/addressbook/main.cpp

@@ -30,7 +30,7 @@
 #include <QQmlContext>
 
 #include "addressbookengine.h"
-#include "qtprotobuf/examples/addressbook.qpb.h"
+#include "addressbook.qpb.h"
 
 #include <QMetaProperty>
 #include <QQmlPropertyMap>

+ 1 - 1
examples/simplechat/main.cpp

@@ -29,7 +29,7 @@
 #include <QQmlApplicationEngine>
 #include <QQmlContext>
 
-#include "qtprotobuf/examples/simplechat.qpb.h"
+#include "simplechat.qpb.h"
 
 #include "simplechatengine.h"
 

+ 1 - 1
examples/simplechat/simplechatengine.cpp

@@ -25,7 +25,7 @@
 
 #include "simplechatengine.h"
 
-#include "qtprotobuf/examples/simplechat_grpc.qpb.h"
+#include "simplechat_grpc.qpb.h"
 
 #include <QGrpcHttp2Channel>
 #include <QGrpcUserPasswordCredentials>

+ 2 - 2
examples/simplechat/simplechatengine.h

@@ -27,8 +27,8 @@
 
 #include <QObject>
 
-#include "qtprotobuf/examples/simplechat.qpb.h"
-#include "qtprotobuf/examples/simplechat_grpc.qpb.h"
+#include "simplechat.qpb.h"
+#include "simplechat_grpc.qpb.h"
 
 #include "universallistmodel.h"
 

+ 4 - 2
src/generator/generator.h

@@ -55,7 +55,7 @@ namespace generator {
  * \section Manual usage
  *
  * \code
- * [QT_PROTOBUF_OPTIONS="[SINGLE|MULTI]:QML:COMMENTS"] protoc --plugin=protoc-gen-qtprotobuf=<path/to/bin/>qtprotobufgen --qtprotobuf_out=<output_dir> [-I/extra/proto/include/path] <protofile>.proto
+ * [QT_PROTOBUF_OPTIONS="[SINGLE|MULTI]:QML:COMMENTS:FOLDER"] protoc --plugin=protoc-gen-qtprotobuf=<path/to/bin/>qtprotobufgen --qtprotobuf_out=<output_dir> [-I/extra/proto/include/path] <protofile>.proto
  * \endcode
  *
  * Generator supports options that could be provided as environment variable to tune generation.
@@ -73,6 +73,8 @@ namespace generator {
  *
  * *COMMENTS* - enables comments copying from .proto files
  *
+ * *FOLDER* - enables folder-based generation
+ *
  * \section cmake CMake
  *
  * For CMake based project QtProtobuf has macroses those should be used to generate code and in link it to your project:
@@ -95,7 +97,7 @@ namespace generator {
  *        \note multi-files generation mode is defined as deprecated by QtProtobuf team, and might have poor support in future
  * \param QML Enables QML code generation in protobuf classes. If provided in parameter list QML related code for lists and QML registration to be generated.
  * \param COMMENTS Enables comments copying from .proto files. If provided in parameter list message and field related comments will be copied to generated header files.
- *
+ * \param FOLDER Enables folder based generation. If provided in parameter list generator will place generated artifacts to folder structure according to package of corresponding .proto file
  *
  * \subsection cmake_qtprotobuf_link_archive qtprotobuf_link_archive
  *

+ 5 - 5
src/generator/generatorbase.cpp

@@ -76,13 +76,13 @@ std::string GeneratorBase::generateBaseName(const ::google::protobuf::FileDescri
     std::vector<std::string> packages;
     utils::split(file->package(), packages, '.');
     std::string outFileBasename = "";
-    for (auto package : packages) {
-        outFileBasename += package + "/";
-    }
-    if (name != "") {
+    if (GeneratorOptions::instance().isFolder()) {
+        for (auto package : packages) {
+            outFileBasename += package + "/";
+        }
         outFileBasename += name;
     } else {
-        outFileBasename += utils::extractFileName(file->name());
+        outFileBasename = name;
     }
 
     return outFileBasename;

+ 1 - 1
src/generator/generatorbase.h

@@ -65,7 +65,7 @@ public:
 
 protected:
     void iterateNonNestedFileds(const ::google::protobuf::FileDescriptor *file, std::function<void(const ::google::protobuf::Descriptor *)> callback) const;
-    static std::string generateBaseName(const ::google::protobuf::FileDescriptor *file, std::string name = "");
+    static std::string generateBaseName(const ::google::protobuf::FileDescriptor *file, std::string name);
 private:
     Mode m_mode;
 };

+ 7 - 1
src/generator/generatoroptions.cpp

@@ -32,12 +32,15 @@
 static const std::string MultifileBuildOption("MULTI");
 static const std::string QmlPluginOption("QML");
 static const std::string CommentsGenerationOption("COMMENTS");
+static const std::string FolderGenerationOption("FOLDER");
+
 
 using namespace ::QtProtobuf::generator;
 
 GeneratorOptions::GeneratorOptions() : mIsMulti(false)
   , mHasQml(false)
   , mGenerateComments(false)
+  , mIsFolder(false)
 {
 }
 
@@ -53,9 +56,12 @@ void GeneratorOptions::parseFromEnv(const std::string &options)
         } else if (option.compare(QmlPluginOption) == 0) {
             QT_PROTOBUF_DEBUG("set mHasQml: true");
             mHasQml = true;
-        } else if (option.compare(CommentsGenerationOption)) {
+        } else if (option.compare(CommentsGenerationOption) == 0) {
             QT_PROTOBUF_DEBUG("set mGenerateComments: true");
             mGenerateComments = true;
+        } else if (option.compare(FolderGenerationOption) == 0) {
+            QT_PROTOBUF_DEBUG("set mIsFolder: true");
+            mIsFolder = true;
         }
     }
 }

+ 2 - 0
src/generator/generatoroptions.h

@@ -49,11 +49,13 @@ public:
     bool isMulti() const { return mIsMulti; }
     bool hasQml() const { return mHasQml; }
     bool generateComments() const { return mGenerateComments; }
+    bool isFolder() const { return mIsFolder; }
 
 private:
     bool mIsMulti;
     bool mHasQml;
     bool mGenerateComments;
+    bool mIsFolder;
 };
 
 }}

+ 5 - 5
src/generator/singlefilegenerator.cpp

@@ -73,7 +73,7 @@ bool SingleFileGenerator::GenerateMessages(const ::google::protobuf::FileDescrip
         return true;
     }
 
-    std::string outFileBasename = generateBaseName(file);
+    std::string outFileBasename = generateBaseName(file, utils::extractFileBasename(file->name()));
     std::set<std::string> internalIncludes;
     std::set<std::string> externalIncludes;
     std::shared_ptr<io::ZeroCopyOutputStream> outHeader(generatorContext->Open(outFileBasename + Templates::ProtoFileSuffix + ".h"));
@@ -96,7 +96,7 @@ bool SingleFileGenerator::GenerateMessages(const ::google::protobuf::FileDescrip
     externalIncludes.insert("QString");
 
     for (int i = 0; i < file->dependency_count(); i++) {
-        internalIncludes.insert(generateBaseName(file->dependency(i)) + Templates::ProtoFileSuffix);
+        internalIncludes.insert(utils::removeFileSuffix(file->dependency(i)->name()) + Templates::ProtoFileSuffix);
     }
 
     for(auto include : externalIncludes) {
@@ -198,7 +198,7 @@ bool SingleFileGenerator::GenerateServices(const ::google::protobuf::FileDescrip
         return true;
     }
 
-    std::string outFileBasename = generateBaseName(file);
+    std::string outFileBasename = generateBaseName(file, utils::extractFileBasename(file->name()));
     std::set<std::string> internalIncludes;
     std::set<std::string> externalIncludes;
     std::shared_ptr<io::ZeroCopyOutputStream> outHeader(generatorContext->Open(outFileBasename + Templates::GrpcFileSuffix + Templates::ProtoFileSuffix + ".h"));
@@ -221,11 +221,11 @@ bool SingleFileGenerator::GenerateServices(const ::google::protobuf::FileDescrip
         for (int i = 0; i < service->method_count(); i++) {
             const MethodDescriptor *method = service->method(i);
             if (method->input_type()->file() != service->file()) {
-                internalIncludes.insert(utils::extractFileName(method->input_type()->file()->name()) + Templates::ProtoFileSuffix);
+                internalIncludes.insert(utils::removeFileSuffix(method->input_type()->file()->name()) + Templates::ProtoFileSuffix);
             }
 
             if (method->output_type()->file() != service->file()) {
-                internalIncludes.insert(utils::extractFileName(method->output_type()->file()->name()) + Templates::ProtoFileSuffix);
+                internalIncludes.insert(utils::removeFileSuffix(method->output_type()->file()->name()) + Templates::ProtoFileSuffix);
             }
         }
     }

+ 8 - 2
src/generator/utils.h

@@ -77,8 +77,14 @@ static void tolower(std::string &str) {
     std::transform(std::begin(str), std::end(str), std::begin(str), ::tolower);
 }
 
-static std::string extractFileName(std::string fileName) {
-    size_t index = fileName.rfind(".proto");
+static std::string removeFileSuffix(std::string fileName) {
+    size_t index = fileName.rfind(".");
+    fileName.resize(index);
+    return fileName;
+}
+
+static std::string extractFileBasename(std::string fileName) {
+    size_t index = fileName.rfind(".");
     fileName.resize(index);
     index = fileName.rfind("/");
     if (index != std::string::npos) {

+ 18 - 5
src/protobuf/parsemessages.go

@@ -17,9 +17,14 @@ func main() {
 	}
 
 	multi := false
-	if len(os.Args) > 2 {
-		if os.Args[2] == "MULTI" {
+	folder := false
+	for i := 2; i < len(os.Args); i++ {
+		if os.Args[i] == "MULTI" {
 			multi = true
+			folder = true //For multi-file generation folder-based approach is enabled by default and could not be switched off
+		}
+		if os.Args[i] == "FOLDER" {
+			folder = true
 		}
 	}
 
@@ -73,7 +78,7 @@ func main() {
 			}
 		}
 	} else {
-		if fullpath == "" {
+		if folder && fullpath == "" {
 			log.Fatalf("Package is not specified correctly in %s file\n", os.Args[1])
 		}
 		//Singlefile version
@@ -103,11 +108,19 @@ func main() {
 		}
 
 		if messageFound {
-			fmt.Printf("%s%s.qpb.h;", fullpath, basename)
+			if folder {
+				fmt.Printf("%s%s.qpb.h;", fullpath, basename)
+			} else {
+				fmt.Printf("%s.qpb.h;", basename)
+			}
 		}
 
 		if serviceFound {
-			fmt.Printf("%s%s_grpc.qpb.h;", fullpath, basename)
+			if folder {
+				fmt.Printf("%s%s_grpc.qpb.h;", fullpath, basename)
+			} else {
+				fmt.Printf("%s_grpc.qpb.h;", basename)
+			}
 		}
 	}
 

+ 1 - 1
src/wellknowntypes/CMakeLists.txt

@@ -34,7 +34,7 @@ function(add_wellknowntype TYPENAME)
                 OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated
                 PROTO_FILES ${PROTO_FILE}
                 PROTO_INCLUDES -I${INCLUDE_DIR}
-                QML)
+                QML FOLDER)
             target_include_directories(${TYPENAME} PRIVATE
                 $<TARGET_PROPERTY:${QT_PROTOBUF_PROJECT}::QtProtobufWellKnownTypes,INTERFACE_INCLUDE_DIRECTORIES>)
             get_target_property(GENERATED_PUBLIC_HEADER_PRIVATE ${TYPENAME} PUBLIC_HEADER)

+ 2 - 0
tests/test_grpc/CMakeLists.txt

@@ -6,10 +6,12 @@ add_test_target(TARGET qtgrpc_test
 add_target_windeployqt(TARGET qtgrpc_test
     QML_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 
+target_link_libraries(qtgrpc_test)
 add_test_target(TARGET qtgrpc_secure_test
     SOURCES sslclienttest.cpp)
 add_target_windeployqt(TARGET qtgrpc_secure_test
     QML_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+target_link_libraries(qtgrpc_secure_test)
 
 # servers
 add_subdirectory(echoserver)

+ 1 - 1
tests/test_grpc/clienttest.cpp

@@ -23,7 +23,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "qtprotobufnamespace/tests/testservice_grpc.qpb.h"
+#include "testservice_grpc.qpb.h"
 #include <QGrpcHttp2Channel>
 #include <QGrpcCredentials>
 #include <QGrpcInsecureCredentials>

+ 1 - 1
tests/test_grpc/sslclienttest.cpp

@@ -23,7 +23,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "qtprotobufnamespace/tests/testservice_grpc.qpb.h"
+#include "testservice_grpc.qpb.h"
 
 #include <QGrpcHttp2Channel>
 #include <QGrpcSslCredentials>

+ 1 - 1
tests/test_protobuf/deserializationtest.cpp

@@ -25,7 +25,7 @@
 
 #include "deserializationtest.h"
 
-#include "qtprotobufnamespace/tests/simpletest.qpb.h"
+#include "simpletest.qpb.h"
 
 using namespace qtprotobufnamespace::tests;
 using namespace QtProtobuf::tests;

+ 1 - 1
tests/test_protobuf/jsonserializationtest.cpp

@@ -29,7 +29,7 @@
 
 #include <qprotobufjsonserializer.h>
 
-#include "qtprotobufnamespace/tests/simpletest.qpb.h"
+#include "simpletest.qpb.h"
 
 using namespace qtprotobufnamespace::tests;
 

+ 1 - 1
tests/test_protobuf/serializationcomplexmessagemap.cpp

@@ -25,7 +25,7 @@
 
 #include "serializationtest.h"
 
-#include "qtprotobufnamespace/tests/simpletest.qpb.h"
+#include "simpletest.qpb.h"
 
 using namespace qtprotobufnamespace::tests;
 using namespace QtProtobuf::tests;

+ 1 - 1
tests/test_protobuf/serializationtest.cpp

@@ -25,7 +25,7 @@
 
 #include "serializationtest.h"
 
-#include "qtprotobufnamespace/tests/simpletest.qpb.h"
+#include "simpletest.qpb.h"
 
 using namespace qtprotobufnamespace::tests;
 using namespace QtProtobuf::tests;

+ 5 - 5
tests/test_protobuf/simpletest.cpp

@@ -23,10 +23,10 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "qtprotobufnamespace/tests/simpletest.qpb.h"
-#include "qtprotobufnamespace/tests/sequence/sequencetest.qpb.h"
-#include "qtprotobufnamespace1/externaltests/externalpackagetest.qpb.h"
-#include "qtprotobufnamespace/tests/globalenums/globalenums.qpb.h"
-#include "qtprotobufnamespace/tests/globalenumssamenamespace.qpb.h"
+#include "simpletest.qpb.h"
+#include "sequencetest.qpb.h"
+#include "externalpackagetest.qpb.h"
+#include "globalenums.qpb.h"
+#include "globalenumssamenamespace.qpb.h"
 
 #include "./simpletest.cpp.inc"

+ 1 - 1
tests/test_qml/main.cpp

@@ -27,7 +27,7 @@
 #include <QQmlEngine>
 #include <QQmlContext>
 
-#include "qtprotobufnamespace/tests/simpletest.qpb.h"
+#include "simpletest.qpb.h"
 
 using namespace qtprotobufnamespace::tests;
 

+ 1 - 1
tests/test_wellknowntypes/simpletest.cpp

@@ -41,7 +41,7 @@
 #include <google/protobuf/wrappers.qpb.h>
 #include <google/protobuf/field_mask.qpb.h>
 
-#include "qtprotobufnamespace/wellknowntypes/tests/wellknowntypes.qpb.h"
+#include "wellknowntypes.qpb.h"
 
 using namespace google::protobuf;