Fixed include directory settings and conditional includes in CMakeLists and test_common.c. Refs #1085.