$OpenBSD$

Index: CMakeLists.txt
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -35,18 +35,18 @@ option(FORCE_LIBSSH "force linking with libssh to work
 option(LIBGIT2_DYNAMIC "search for libgit2.so before libgit2.a" OFF)
 
 #Options regarding disabling parts of subsurface.
-option(NO_DOCS "disable the docs" OFF)
-option(NO_PRINTING "disable the printing support" OFF)
+option(NO_DOCS "disable the docs" ON)
+option(NO_PRINTING "disable the printing support" ON)
 option(NO_USERMANUAL "don't include a viewer for the user manual" OFF)
 
 #Options regarding enabling parts of subsurface
 option(FBSUPPORT "allow posting to Facebook" ON)
-option(BTSUPPORT "enable support for QtBluetooth (requires Qt5.4 or newer)" ON)
+option(BTSUPPORT "enable support for QtBluetooth (requires Qt5.4 or newer)" OFF)
 option(FTDISUPPORT "enable support for libftdi based serial" OFF)
 option(USE_WEBENGINE "Use QWebEngine instead of QWebKit" OFF)
 
 # Options regarding What should we build on subsurface
-option(MAKE_TESTS "Make the tests" ON)
+option(MAKE_TESTS "Make the tests" OFF)
 
 SET(SUBSURFACE_TARGET_EXECUTABLE "DesktopExecutable" CACHE STRING "The type of application, DesktopExecutable or MobileExecutable")
 LIST(APPEND SUBSURFACE_ACCEPTED_EXECUTABLES  "DesktopExecutable" "MobileExecutable")
@@ -122,7 +122,6 @@ include(pkgconfig_helper)
 # if you think a module miss anything, take a look on the specific
 # module file.
 include(HandleFindGit2)
-include(HandleFindLibDiveComputer)
 if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "DesktopExecutable")
         include(HandleFindGrantlee)
 	include(HandleUserManual)
@@ -147,6 +146,8 @@ include_directories(.
 	${CMAKE_CURRENT_BINARY_DIR}
 	${CMAKE_BINARY_DIR}
 	${CMAKE_BINARY_DIR}/desktop-widgets
+	${CMAKE_SOURCE_DIR}/libdivecomputer/include
+	${CMAKE_SOURCE_DIR}/libdivecomputer/build/include
 )
 
 # Project Target specific configuration should go here,
@@ -260,7 +261,7 @@ if(BLESUPPORT)
 endif()
 
 #set up the subsurface_link_libraries variable
-set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${LIBDIVECOMPUTER_LIBRARIES} ${LIBGIT2_LIBRARIES} ${LIBUSB_LIBRARIES})
+set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${LIBGIT2_LIBRARIES} ${LIBUSB_LIBRARIES})
 qt5_add_resources(SUBSURFACE_RESOURCES subsurface.qrc map-widget/qml/map-widget.qrc)
 
 # include translations
@@ -323,6 +324,9 @@ elseif(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "Deskto
                 add_executable(${SUBSURFACE_TARGET} MACOSX_BUNDLE WIN32 ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
         endif()
 
+	add_library(subsurface_dc STATIC IMPORTED)
+	set_target_properties(subsurface_dc PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libdivecomputer/build/src/.libs/libdivecomputer.a)
+
 	if(FBSUPPORT)
 		set(FACEBOOK_INTEGRATION facebook_integration)
 		add_dependencies(facebook_integration subsurface_generated_ui)
@@ -336,6 +340,7 @@ elseif(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "Deskto
 		subsurface_statistics
 		subsurface_models_desktop
 		subsurface_corelib
+		subsurface_dc
 		${SUBSURFACE_LINK_LIBRARIES}
 	)
 	add_dependencies(subsurface_desktop_preferences subsurface_generated_ui)
@@ -503,7 +508,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
 		COMMAND ${MAKENSIS} ${WINDOWSSTAGING}/subsurface.nsi
 		DEPENDS fake_install
 	)
-elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
 	# the syntax is odd, but this searches for libqtgeoservices_googlemaps.so
 	# in the filesystem below our install-root
 	# different Linux flavors put the plugin in different directories
@@ -516,12 +521,12 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
 			mkdir -p ${CMAKE_BINARY_DIR}/geoservices &&
 			ln -sf ${GOOGLEMAPS} ${CMAKE_BINARY_DIR}/geoservices)
 	endif()
-	install(FILES subsurface.debug DESTINATION bin)
+	#install(FILES subsurface.debug DESTINATION bin)
 	install(FILES subsurface.desktop DESTINATION share/applications)
 	install(FILES appdata/subsurface.appdata.xml DESTINATION share/metainfo)
 	install(FILES icons/subsurface-icon.svg DESTINATION share/icons/hicolor/scalable/apps)
-	install(DIRECTORY Documentation/images DESTINATION share/subsurface/Documentation)
-	install(FILES ${DOCFILES} DESTINATION share/subsurface/Documentation)
+	#install(DIRECTORY Documentation/images DESTINATION share/subsurface/Documentation)
+	#install(FILES ${DOCFILES} DESTINATION share/subsurface/Documentation)
 	install(DIRECTORY theme DESTINATION share/subsurface)
 	install(DIRECTORY printing_templates DESTINATION share/subsurface)
 	install(FILES ${TRANSLATIONS} DESTINATION share/subsurface/translations)
