Add plateform detection in CMakeLists