--- CMakeLists.txt.orig 2021-02-01 18:41:51 UTC +++ CMakeLists.txt @@ -67,6 +67,13 @@ add_executable(${PROJECT_NAME} zeroconf/hotplugnotifier.cpp ${ZEROCONF_FILES} ) + +if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(USB_LIBRARY usb) +else() + set(USB_LIBRARY usb-1.0) +endif() + target_link_libraries( ${PROJECT_NAME} Threads::Threads @@ -74,7 +79,7 @@ target_link_libraries( jpeg png ${ZEROCONF_LIBS} - usb-1.0 + ${USB_LIBRARY} ) if(APPLE) @@ -102,8 +107,31 @@ install(CODE " endif() ") +elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") +set(STAGEDIR "%%STAGEDIR%%") + +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION sbin +) + +install(CODE " + if(NOT EXISTS ${STAGEDIR}/usr/local/etc/airsane/ignore.conf) + file(INSTALL ${CMAKE_SOURCE_DIR}/etc/ignore.conf DESTINATION /usr/local/etc/airsane) + endif() +") +install(CODE " + if(NOT EXISTS ${STAGEDIR}/usr/local/etc/airsane/options.conf) + file(INSTALL ${CMAKE_SOURCE_DIR}/etc/options.conf DESTINATION /usr/local/etc/airsane) + endif() +") +install(CODE " + if(NOT EXISTS ${STAGEDIR}/usr/local/etc/airsane/Gnome-scanner.png) + file(INSTALL ${CMAKE_SOURCE_DIR}/etc/Gnome-scanner.png DESTINATION /usr/local/etc/airsane) + endif() +") + else() install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin