if (UNIX)
  macro(install_symlink filepath sympath)
    install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${filepath} ${sympath})")
    install(CODE "message(\"-- Created symlink: ${sympath} -> ${filepath}\")")
  endmacro(install_symlink)

  install(TARGETS repertory RUNTIME DESTINATION share/repertory)
  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/cacert.pem RUNTIME DESTINATION share/repertory)
  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.md RUNTIME DESTINATION share/repertory)
  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/CONTRIBUTORS.md RUNTIME DESTINATION share/repertory)
  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md RUNTIME DESTINATION share/repertory)
  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.md RUNTIME DESTINATION share/repertory)
  if (LINUX)
    install_symlink(${CMAKE_INSTALL_PREFIX}/share/repertory/repertory ${CMAKE_INSTALL_PREFIX}/sbin/mount.repertory)
    install_symlink(${CMAKE_INSTALL_PREFIX}/share/repertory/repertory ${CMAKE_INSTALL_PREFIX}/sbin/repertory)
  endif()
endif()
