Normally installs from the official distro packages go into /usr/bin or /usr/games, while installs from source go into /usr/local/bin. Likewise for the accompanying data files (/usr/share vs. /usr/local/share). So there is no collision between the files. But the names are the same, so when you when you issue the command 'xboard' it depends on the order these directories are mentioned in your $PATH which one will be executed. You can still execute the other one by typing its full path name.
I don't know code::blocks. I suppose you could make a XBoard a project for it, but it is not one of the supported platforms. (So no project file for it is included, like there is for MSVC.) Using the standard install procedure (./configure; make; sudo make install) should be completely trivial, though. If ./configure would complain about missing packages, (like libraries) you could not compile otherwise without first installing these packages too.