Solution for this described there: http://tinyguides.blogspot.ru/2013/04/multiple-binaries-in-single-eclipse-cdt.html.
There is an excerpt:
- Create a managed project (File > New C++ Project > Executable)
- Add the source code containing multiple main() functions
- Go to Project > Properties > C/C++ General > Path & Symbols > Manage Configurations
- Make a build configuration for each executable and name it appropriately (you can clone existing configurations like Debug and Release).
- From the project explorer, right click on each source file that contains a main() function > Resource Configurations > Exclude from Build and exclude all build configurations except the one that builds the executable with this main() function
- All other code is included in all build configurations by default. You may need to change this depending on your application.
- You can now build an executable for each main function by going to Project > Build Configurations > Set Active , Project > Build Project