This reverts commit df839cfd. This change used cmake's list filter operation which was not added until cmake 3.6.