Skip to content

Commit

Permalink
fix: respect CMAKE_INSTALL_PREFIX on macOS (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecaralice authored Feb 14, 2024
1 parent b6a8b17 commit c62db85
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,30 +117,30 @@ endif()
if(APPLE)

install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION /usr/local/sbin
RUNTIME DESTINATION sbin
)
install(FILES launchd/org.simulpiscator.airsaned.plist
DESTINATION /Library/LaunchDaemons
)

install(CODE "
if(NOT EXISTS /usr/local/etc/airsane/access.conf)
file(INSTALL ${CMAKE_SOURCE_DIR}/etc/access.conf DESTINATION /usr/local/etc/airsane)
if(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/etc/airsane/access.conf)
file(INSTALL ${CMAKE_SOURCE_DIR}/etc/access.conf DESTINATION ${CMAKE_INSTALL_PREFIX}/etc/airsane)
endif()
")
install(CODE "
if(NOT EXISTS /usr/local/etc/airsane/ignore.conf)
file(INSTALL ${CMAKE_SOURCE_DIR}/etc/ignore.conf DESTINATION /usr/local/etc/airsane)
if(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/etc/airsane/ignore.conf)
file(INSTALL ${CMAKE_SOURCE_DIR}/etc/ignore.conf DESTINATION ${CMAKE_INSTALL_PREFIX}/etc/airsane)
endif()
")
install(CODE "
if(NOT EXISTS /usr/local/etc/airsane/options.conf)
file(INSTALL ${CMAKE_SOURCE_DIR}/etc/options.conf DESTINATION /usr/local/etc/airsane)
if(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/etc/airsane/options.conf)
file(INSTALL ${CMAKE_SOURCE_DIR}/etc/options.conf DESTINATION ${CMAKE_INSTALL_PREFIX}/etc/airsane)
endif()
")
install(CODE "
if(NOT EXISTS /usr/local/etc/airsane/Gnome-scanner.png)
file(INSTALL ${CMAKE_SOURCE_DIR}/etc/Gnome-scanner.png DESTINATION /usr/local/etc/airsane)
if(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/etc/airsane/Gnome-scanner.png)
file(INSTALL ${CMAKE_SOURCE_DIR}/etc/Gnome-scanner.png DESTINATION ${CMAKE_INSTALL_PREFIX}/etc/airsane)
endif()
")

Expand Down

0 comments on commit c62db85

Please sign in to comment.