瀏覽代碼

Fix build issue because of unresolved dependency

Alexey Edelev 6 年之前
父節點
當前提交
3721f01e29
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      CMakeLists.txt

+ 2 - 0
CMakeLists.txt

@@ -76,6 +76,7 @@ if(MAKE_TESTS)
             COMMAND ${PROTOBUF_INSTALATION_PATH}/bin/protoc.exe --plugin=protoc-gen-${PROJECT_NAME}=${CMAKE_BINARY_DIR}/qtprotobuf.exe --qtprotobuf_out=${CMAKE_CURRENT_BINARY_DIR}/tests
             ${PROTO_FILES}
             WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/proto/
+            DEPENDS ${PROJECT_NAME} ${PROTO_FILES}
             COMMENT "Generating test headers"
             )
     elseif(UNIX)
@@ -88,6 +89,7 @@ if(MAKE_TESTS)
             )
     endif()
 
+    add_dependencies(${testgeneration} ${PROJECT_NAME})
     add_subdirectory("tests")
 endif()