Implement some CMakeLists.txt changes to simplify port.c