Updated code to obey BUILD_TESTING to allow for disabling of test compilation

Currently the BUILD_TESTING flag is ignored within the CMake configuration. This change wraps the addition of the tests to see if we have enabled the flag and only adds the test directories only if we have. This reduces the compilation time and install space for any end users (such as myself) who do not need to build or run the tests on their machines.

As BUILD_TESTING is enabled by default this should only affect people who wish to change it.