To make this minecart route work, you will need two rock stockpiles. One inside the mine, where dwarves will place rocks next to the loading zone for the minecart. One outside near the masonry workshops or wherever you are sending it.
You also need two track stops, one for each stockpile. "Track stop" is a bit ambiguous since there are two kinds: the physical building, and the more esoteric point of interest on a route (for clarity, I will call this second kind a "route stop.") Basically, you will build the physical track stop (b > C > S) and then assign a route stop for a route over that building. For this two-stop system, you want each of them to be at highest friction (this will stop the carts from moving when they pass over them, so they can wait to be loaded.) The track stop near the workshops should also dump contents to an adjacent tile. This tile should have a 1x1 rock stockpile that your masons will take from (there needs to be a stockpile here or else your dwarves will haul the stone back down to the mines to fill the other stockpile.)
Make a route (h > r), name it whatever you want.
Then move your cursor over to where you want the first stop to be (your first track stop), press s to assign a new stop.
Continue adding stops where appropriate in the order that the minecarts will visit them. You can name the stops just like the route with n.
A route stop can have two things added to it: departure conditions and stockpile links.
Stockpile links to a route stop work in much the same way links between two stockpiles do. You tell the stop what stockpile you want to take from, but also what things you want to take. For example, you could take from a pile that contains rocks and gems, but only load carts with the rocks or even just one kind of rock. In your system, you could do with a stockpile of only rocks, taking only rocks.
To make a stockpile link, press s.
Move your cursor to the pile you want to link to and press p.
Press enter to set the desired items you want to receive from that link.
Departure conditions dictate where a cart should go from the stop, when a cart should go, and how it should leave.
Direction (North, South, East, West) can be toggled with d.
How the cart gets moved from the stop (Push, Ride, Guide) can be changed with p. Pushing and riding are what their name implies, a dwarf shoves the cart away maybe jumping in as he does so. This will not work for sending carts uphill without powered rollers, and anything on the track when the cart comes by is in for some pain. Guide will have your dwarf push the cart down the track the whole way (like a shopping cart), actively avoiding obstacles. You probably want to guide, unless you are ambitious to set up rollers.
The timing factor is perhaps the most tricky. You can have it set to go when the cart is at a certain capacity (from full to empty), AND after a certain amount of time (from immediate to any number of days).
Ideally, you want to send the cart from the route stop in the mine as soon as it is full, so set this to immediate (tT to change wait time) and 'when full of desired items' (c to toggle condition.) The route stop at the workshops can be sent back as soon as it offloads, which is immediate thanks to the track stop, so set this to go 'immediately' and 'always.' (You don't really need a route stop here if you make the track stop have no friction and just dump, and have your track set up to loop around back to the mine, but this requires a continuous track circuit or a switchback)
You CAN have more than one departure condition for a route stop (and more than one stockpile link, but only one set of desired items.) The stop will send the cart away accordingly whenever one of them is satisfied. Think of it as 'depart when condition A is met OR condition B is met OR ...' You don't need multiple conditions, but it might be a good idea if you run out of rocks to load and the cart isn't full. It could default to being sent after X days regardless of how full it is, this way you can get the stone still in the cart without having to get more stone to top it off.
ninja'd. Deathworks has some good points about stockpile links that I forgot about completely missed.