Done using CMake options whenever possible as part of the build process (closes #354).