--- CMakeLists.txt.orig	2019-10-27 22:02:14 UTC
+++ CMakeLists.txt
@@ -41,7 +41,7 @@ else()
 endif()
 
 set(CMAKE_CXX_FLAGS_DEBUG "-g")
-set(CMAKE_CXX_FLAGS_RELEASE "-O3")
+#set(CMAKE_CXX_FLAGS_RELEASE "-O3")
 
 message(STATUS "Building ${CMAKE_BUILD_TYPE}")
 
@@ -71,13 +71,15 @@ if(UNIX)
     ${UnixCFlags})
 endif()
 
-if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
 
   find_package(OpenGL REQUIRED)
   find_package(GTK2 2.6 REQUIRED gtk)
   find_package(X11 REQUIRED)
   find_library(XINPUT_LIBRARY libXi.so)
   find_package(Threads REQUIRED)
+  find_package(SDL2 REQUIRED)
+  find_package(SDL2_image REQUIRED)
 
   if(XINPUT_LIBRARY STREQUAL "XINPUT_LIBRARY-NOTFOUND")
       message(FATAL_ERROR "Could not find libXi.so")
@@ -98,7 +100,6 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
   target_include_directories(Milton PRIVATE
     ${GTK2_INCLUDE_DIRS}
     ${X11_INCLUDE_DIR}
-    ${SDL2DIR}/build/linux64/include/SDL2
     ${OPENGL_INCLUDE_DIR}
   )
 
@@ -107,8 +108,8 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
     ${X11_LIBRARIES}
     ${OPENGL_LIBRARIES}
     ${XINPUT_LIBRARY}
-    ${SDL2DIR}/build/linux64/lib/libSDL2maind.a
-    ${SDL2DIR}/build/linux64/lib/libSDL2d.a
+    SDL2::SDL2
+    SDL2_image::SDL2_image
     ${CMAKE_THREAD_LIBS_INIT}
     ${CMAKE_DL_LIBS}
     )
@@ -132,11 +133,8 @@ if(WIN32 OR APPLE)
 endif()
 
 add_custom_command(TARGET Milton POST_BUILD
-  COMMAND ${CMAKE_COMMAND} -E copy
+  COMMAND icotool -x
     ${CMAKE_CURRENT_LIST_DIR}/milton_icon.ico
-    ${CMAKE_CURRENT_LIST_DIR}/third_party/Carlito.ttf
-    ${CMAKE_CURRENT_LIST_DIR}/third_party/Carlito.LICENSE
-    $<TARGET_FILE_DIR:Milton>
 )
 
 add_dependencies(Milton shadergen)
