title: CMakeList to generate .cc and .h files from .proto file under a specific folder
body: <p>I have the following CMakeList commands in my CMakeLists.txt file and I would like to generate .cc and .h files under <code>src-gen</code> folder which is under my main folder, where <code>src</code>, <code>include</code> and other stuff are. I put the commands to see if they work, but they still get generated outside of <code>src-gen</code> folder, so it does not work.</p>
  
  <pre><code>include(FindProtobuf)
  
  set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
  set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
  set_source_files_properties(${PROTO_SRC} ${PROTO_HEADER} PROPERTIES GENERATED TRUE)
  
  set(PROTO_SRC ${PROTO_SRC} ${PROJECT_SOURCE_DIR}/src-gen) #does not work..
  set(PROTO_HEADER ${PROTO_HEADER} ${PROJECT_SOURCE_DIR}/src-gen)#does not work..
  
  find_package(Protobuf REQUIRED)
  
  PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS proto/VisionData.proto)
  
  include_directories(
    ${PROTOBUF_INCLUDE_DIRS}
    include
  )
  
  add_executable(cameraSubscriber src/main.cpp ${PROTO_SRCS} ${PROTO_HDRS})
  
  target_link_libraries(cameraSubscriber
     ${PROTOBUF_LIBRARIES}
   )
  </code></pre>
  
  <p>Does anyone know where the mistake is, or what should I add if necessary?</p>