From a339b35794dfd9ddc5109e4dfbf705b9dd532953 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Fri, 4 Jun 2021 17:59:44 +0200
Subject: Haiku supporting patches


diff --git a/CMakeLists.txt b/CMakeLists.txt
index c666c0f..8da975b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -177,13 +177,28 @@ file (GLOB TS_FILES
     translations/flacon*.ts
 )
 
-set(DATA_DIR
-    ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}
-)
+if(NOT DEFINED DATA_DIR)
+    set(DATA_DIR
+        ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}
+    )
+endif()
+
+if(NOT DEFINED TRANSLATIONS_DIR)
+    set(TRANSLATIONS_DIR
+        "${DATA_DIR}/translations"
+    )
+endif()
+
+if(NOT DEFINED MAN_DIR)
+    set(MAN_DIR
+        ${CMAKE_INSTALL_PREFIX}/share/man/man1
+    )
+endif()
+
+if(NOT DEFINED BIN_DIR)
+    set(BIN_DIR bin)
+endif()
 
-set(TRANSLATIONS_DIR
-    "${DATA_DIR}/translations"
-)
 add_definitions(-DTRANSLATIONS_DIR=\"${TRANSLATIONS_DIR}\")
 
 set (CMAKE_CXX_STANDARD 14)
@@ -329,7 +344,7 @@ add_custom_command(TARGET ${PROJECT_NAME}
     COMMAND gzip -c -n ${CMAKE_CURRENT_BINARY_DIR}/flacon.1 > ${CMAKE_CURRENT_BINARY_DIR}/flacon.1.gz
 )
 
-
+if(NOT HAIKU)
 if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
     set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "Flacon")
     install(TARGETS ${PROJECT_NAME} RUNTIME                 DESTINATION Flacon.app/Contents/MacOS)
@@ -355,6 +370,10 @@ else()
     install(FILES   images/mainicon/flacon.svg         DESTINATION "share/icons/hicolor/scalable/apps" RENAME "flacon.svg")
 
 endif()
+else()
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/flacon.1.gz DESTINATION ${MAN_DIR})
+    install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${BIN_DIR})
+endif()
 
 include("cmake/tests.cmake")
 add_tests(tests)
-- 
2.30.2

