فهرست منبع

Few fixes in build files

- Rename qttools to examples_common(qttools project is existing qt project)
- Partially fixed #124
Alexey Edelev 5 سال پیش
والد
کامیت
e0ad28c8e1

+ 3 - 1
cmake/ProtobufLookup.cmake

@@ -39,7 +39,9 @@ if(NOT Protobuf_FOUND)
             message(STATUS "Found protobuf installation: ${Protobuf_PROTOC_EXECUTABLE} ${Protobuf_PROTOC_LIBRARY} ${Protobuf_LIBRARY}")
         else()
             message(FATAL_ERROR "Protobuf is a hard dependency of the project. You may install it (with gRPC) by following instructions in cmake/gRPCBuild.cmake script.")
-            unset(Protobuf_LIBRARY Protobuf_PROTOC_EXECUTABLE Protobuf_PROTOC_LIBRARY)
+            unset(Protobuf_LIBRARY)
+            unset(Protobuf_PROTOC_EXECUTABLE)
+            unset(Protobuf_PROTOC_LIBRARY)
         endif()
     endif()
 endif()

+ 3 - 1
cmake/gRPCLookup.cmake

@@ -35,7 +35,9 @@ if(NOT gRPC_FOUND)
                 AND NOT gRPC_CPP_LIBRARY STREQUAL gRPC_LIBRARY-NOTFOUND)
             set(gRPC_FOUND TRUE)
         else()
-            unset(gRPC_LIBRARY gRPC_CPP_PLUGIN_EXECUTABLE gRPC_CPP_LIBRARY)
+            unset(gRPC_LIBRARY)
+            unset(gRPC_CPP_PLUGIN_EXECUTABLE)
+            unset(gRPC_CPP_LIBRARY)
         endif()
     endif()
 endif()

+ 1 - 1
examples/CMakeLists.txt

@@ -2,4 +2,4 @@ add_subdirectory("addressbook")
 add_subdirectory("addressbookserver")
 add_subdirectory("simplechat")
 add_subdirectory("simplechatserver")
-add_subdirectory("qttools")
+add_subdirectory("examples_common")

+ 2 - 2
examples/addressbook/CMakeLists.txt

@@ -34,6 +34,6 @@ file(GLOB SOURCES main.cpp
 file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../addressbookserver/cert.pem DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
 
 add_executable(${TARGET} ${SOURCES} resources.qrc)
-add_dependencies(${TARGET} ${QtProtobuf_GENERATED} qttools)
+add_dependencies(${TARGET} ${QtProtobuf_GENERATED} examples_common)
 target_include_directories(${TARGET} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/generated)
-target_link_libraries(${TARGET} qttools QtProtobufProject::QtProtobuf QtProtobufProject::QtGrpc ${QtProtobuf_GENERATED} Qt5::Quick Qt5::Qml)
+target_link_libraries(${TARGET} examples_common QtProtobufProject::QtProtobuf QtProtobufProject::QtGrpc ${QtProtobuf_GENERATED} Qt5::Quick Qt5::Qml)

+ 3 - 3
examples/qttools/CMakeLists.txt → examples/examples_common/CMakeLists.txt

@@ -13,7 +13,7 @@ file(GLOB SOURCES
 )
 
 # headers added to make them visible in IDE
-add_library(qttools ${SOURCES} ${HEADERS})
+add_library(examples_common ${SOURCES} ${HEADERS})
 
-target_include_directories(qttools PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
-target_link_libraries(qttools Qt5::Core)
+target_include_directories(examples_common PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+target_link_libraries(examples_common Qt5::Core)

+ 0 - 0
examples/qttools/universallistmodel.cpp → examples/examples_common/universallistmodel.cpp


+ 0 - 0
examples/qttools/universallistmodel.h → examples/examples_common/universallistmodel.h


+ 0 - 0
examples/qttools/universallistmodelbase.cpp → examples/examples_common/universallistmodelbase.cpp


+ 0 - 0
examples/qttools/universallistmodelbase.h → examples/examples_common/universallistmodelbase.h


+ 2 - 2
examples/simplechat/CMakeLists.txt

@@ -30,6 +30,6 @@ file(GLOB SOURCES main.cpp
 file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../simplechatserver/cert.pem DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
 
 add_executable(${TARGET} ${SOURCES} resources.qrc)
-add_dependencies(${TARGET} ${QtProtobuf_GENERATED} qttools)
+add_dependencies(${TARGET} ${QtProtobuf_GENERATED} examples_common)
 target_include_directories(${TARGET} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/generated)
-target_link_libraries(${TARGET} qttools QtProtobufProject::QtProtobuf QtProtobufProject::QtGrpc ${QtProtobuf_GENERATED} Qt5::Quick Qt5::Qml)
+target_link_libraries(${TARGET} examples_common QtProtobufProject::QtProtobuf QtProtobufProject::QtGrpc ${QtProtobuf_GENERATED} Qt5::Quick Qt5::Qml)