Added the OPTIONAL_DIRS variable for specifying optional directories to build.