diff dep/animia/CMakeLists.txt @ 166:54c5d80a737e

dep/animia: add libutil method I changed the "linux" method to be "proc", because it isn't exactly Linux specific this commit also has some changes to the x11 stuff: instead of enumerating over only top-level windows, we iterate over ALL of them this is because many X11 apps actually use multiple windows for some reason, I still can't get it to work with VLC, but it picks up Firefox...
author paper@DavesDouble.local
date Sun, 19 Nov 2023 04:21:56 -0500
parents 44c5e6dd9488
children e44b7c428d7c
line wrap: on
line diff
--- a/dep/animia/CMakeLists.txt	Sat Nov 18 01:12:02 2023 -0500
+++ b/dep/animia/CMakeLists.txt	Sun Nov 19 04:21:56 2023 -0500
@@ -57,11 +57,25 @@
 	if(LINUX)
 		list(APPEND DEFINES LINUX)
 		list(APPEND SRC_FILES
-			# linux
-			src/fd/linux.cc
+			src/fd/proc.cc
 		)
 	endif() # LINUX
 
+	# FreeBSD
+	find_library(LIBUTIL_LIBRARY util)
+	if(LIBUTIL_LIBRARY)
+		get_filename_component(LIBUTIL_DIR ${LIBUTIL_LIBRARY} DIRECTORY)
+
+		include(CheckLibraryExists)
+		check_library_exists(util kinfo_getfile ${LIBUTIL_DIR} LIBUTIL_GOOD)
+
+		if(LIBUTIL_GOOD)
+			list(APPEND LIBRARIES ${LIBUTIL_LIBRARY})
+			list(APPEND DEFINES LIBUTIL)
+			list(APPEND SRC_FILES src/fd/libutil.cc)
+		endif() # LIBUTIL_GOOD
+	endif() # LIBUTIL_LIBRARY
+
 	# X11
 	find_package(X11 COMPONENTS X11)
 	if(X11_FOUND)
@@ -90,7 +104,7 @@
 					${X11_INCLUDE_DIRS}
 				)
 				list(APPEND LIBRARIES
-					${X11_LIBRARIES}
+					${X11_LINK_LIBRARIES}
 				)
 			endif() # X11_FOUND
 		endif() # PKG_CONFIG_FOUND