diff CMakeLists.txt @ 5:51ae25154b70

Fix OS X support code
author Paper <mrpapersonic@gmail.com>
date Sat, 12 Aug 2023 13:10:34 -0400
parents 5af270662505
children 1d82f6e04d7d
line wrap: on
line diff
--- a/CMakeLists.txt	Sat Aug 12 12:08:16 2023 -0400
+++ b/CMakeLists.txt	Sat Aug 12 13:10:34 2023 -0400
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 3.5)
-project(weeaboo)
+cmake_minimum_required(VERSION 3.16)
+project(weeaboo LANGUAGES CXX OBJCXX)
 
 set(SRC_FILES
 	src/main.cpp
@@ -20,7 +20,10 @@
 )
 
 if(APPLE)
-	list(APPEND SRC_FILES src/sys/osx/dark_theme.mm)
+	list(APPEND SRC_FILES
+		src/sys/osx/dark_theme.mm
+		src/sys/osx/filesystem.mm
+	)
 elseif(WIN32)
 	list(APPEND SRC_FILES src/sys/win32/dark_theme.cpp)
 endif()
@@ -32,6 +35,20 @@
 
 find_package(Qt5 COMPONENTS Widgets REQUIRED)
 find_package(CURL REQUIRED)
+
+set(LIBRARIES
+	${Qt5Widgets_LIBRARIES}
+	${CURL_LIBRARIES}
+)
+
+if(APPLE)
+	find_library(COCOA_LIBRARY Cocoa)
+	list(APPEND LIBRARIES ${COCOA_LIBRARY})
+endif()
+
 target_include_directories(weeaboo PUBLIC ${Qt5Widgets_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} PRIVATE src/include src/icons)
 target_compile_options(weeaboo PRIVATE -Wall -Wextra -Wsuggest-override)
-target_link_libraries(weeaboo ${Qt5Widgets_LIBRARIES} ${CURL_LIBRARIES})
+if(APPLE)
+	target_compile_definitions(weeaboo PUBLIC MACOSX)
+endif()
+target_link_libraries(weeaboo ${LIBRARIES})