Revert "Simpler portability cmake"

This reverts commit 9afad9eb5ef5451c2daf13942d2930e98c3069f6.