Changeset View
Changeset View
Standalone View
Standalone View
graphics/airsaned/files/patch-CMakeLists.txt
- This file was added.
--- CMakeLists.txt.orig 2021-09-18 16:22:32 UTC | |||||
+++ CMakeLists.txt | |||||
@@ -20,6 +20,7 @@ endif() | |||||
set(THREADS_PREFER_PTHREAD_FLAG ON) | |||||
find_package(Threads REQUIRED) | |||||
+include(GNUInstallDirs) | |||||
include_directories(.) | |||||
if(APPLE) | |||||
@@ -66,6 +67,13 @@ add_executable(${PROJECT_NAME} | |||||
zeroconf/hotplugnotifier.cpp | |||||
${ZEROCONF_FILES} | |||||
) | |||||
+ | |||||
+if(CMAKE_SYSTEM_NAME STREQUAL FreeBSD) | |||||
arrowd: I'd rather do this
```
if(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
set(USB_LIBRARY usb-1.0)
else… | |||||
+ set(USB_LIBRARY usb) | |||||
+else() | |||||
+ set(USB_LIBRARY usb-1.0) | |||||
+endif() | |||||
+ | |||||
target_link_libraries( | |||||
${PROJECT_NAME} | |||||
Threads::Threads | |||||
@@ -73,7 +81,7 @@ target_link_libraries( | |||||
jpeg | |||||
png | |||||
${ZEROCONF_LIBS} | |||||
- usb-1.0 | |||||
+ ${USB_LIBRARY} | |||||
) | |||||
if(APPLE) | |||||
@@ -105,8 +113,10 @@ install(CODE " | |||||
else() | |||||
install(TARGETS ${PROJECT_NAME} | |||||
Done Inline ActionsDitto, probably? Do we really need to repeat the whole block of install() calls? Another problem is that it installs into fixed prefix. I think you can just write DESTINATION etc/airsane it will work automagically. arrowd: Ditto, probably? Do we really need to repeat the whole block of `install()` calls?
Another… | |||||
- RUNTIME DESTINATION bin | |||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} | |||||
) | |||||
+ | |||||
+if(CMAKE_SYSTEM_NAME STREQUAL Linux) | |||||
install(FILES systemd/airsaned.service | |||||
DESTINATION /lib/systemd/system | |||||
) | |||||
@@ -114,20 +124,21 @@ install(FILES systemd/airsaned.default | |||||
DESTINATION /etc/default | |||||
RENAME airsane | |||||
) | |||||
+endif() | |||||
install(CODE " | |||||
if(NOT EXISTS /etc/airsane/ignore.conf) | |||||
- file(INSTALL ${CMAKE_SOURCE_DIR}/etc/ignore.conf DESTINATION /etc/airsane) | |||||
+ file(INSTALL ${CMAKE_SOURCE_DIR}/etc/ignore.conf DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/airsane) | |||||
endif() | |||||
") | |||||
install(CODE " | |||||
if(NOT EXISTS /etc/airsane/options.conf) | |||||
- file(INSTALL ${CMAKE_SOURCE_DIR}/etc/options.conf DESTINATION /etc/airsane) | |||||
+ file(INSTALL ${CMAKE_SOURCE_DIR}/etc/options.conf DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/airsane) | |||||
endif() | |||||
") | |||||
install(CODE " | |||||
if(NOT EXISTS /etc/airsane/Gnome-scanner.png) | |||||
- file(INSTALL ${CMAKE_SOURCE_DIR}/etc/Gnome-scanner.png DESTINATION /etc/airsane) | |||||
+ file(INSTALL ${CMAKE_SOURCE_DIR}/etc/Gnome-scanner.png DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/airsane) | |||||
endif() | |||||
") | |||||
I'd rather do this
and the use ${USB_LIBRARY} in the target_link_libraries()call.