From c8c2a0b2378b8baf4e47fcb83fca1efd8573923f Mon Sep 17 00:00:00 2001
From: Leon Styhre <leon@leonstyhre.com>
Date: Fri, 2 Apr 2021 12:38:31 +0200
Subject: [PATCH] The man page for BSD Unix is now placed in the correct
 location.

---
 es-app/CMakeLists.txt | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/es-app/CMakeLists.txt b/es-app/CMakeLists.txt
index e2c03f3f2..335ef4e78 100644
--- a/es-app/CMakeLists.txt
+++ b/es-app/CMakeLists.txt
@@ -191,8 +191,13 @@ elseif(APPLE)
 else()
     install(TARGETS emulationstation RUNTIME
             DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
-    install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/emulationstation.6.gz
-            DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man6)
+    if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+        install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/emulationstation.6.gz
+                DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man6)
+    else()
+        install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/emulationstation.6.gz
+                DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man6)
+    endif()
     install(FILES ${CMAKE_SOURCE_DIR}/LICENSE
             DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation)
     install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/emulationstation.desktop