$NetBSD$

Support BSDs.

--- CMakeLists.txt.orig	2020-01-29 14:15:47.010539816 +0000
+++ CMakeLists.txt
@@ -42,6 +42,18 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
     TARGET_LINK_LIBRARIES(cosmo_engine dl m ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARIES})
 ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
 
+IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+    TARGET_LINK_LIBRARIES(cosmo_engine m ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARIES})
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+
+IF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
+    TARGET_LINK_LIBRARIES(cosmo_engine m ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARIES})
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+
+IF(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
+    TARGET_LINK_LIBRARIES(cosmo_engine m ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARIES})
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+
 IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
     TARGET_LINK_LIBRARIES(cosmo_engine ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARIES})
 ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
