# CMake module for choosing install paths
# Defines:
#   IMAGESTEGO_BINARY_DESTINATION
#   IMAGESTEGO_LIBRARY_DESTINATION
#   IMAGESTEGO_ARCHIVE_DESTINATION
#   IMAGESTEGO_CONFIG_DESTINATION
#   IMAGESTEGO_INCLUDE_DESTINATION

if (IMAGESTEGO_WIN)
  if (DEFINED IMAGESTEGO_RUNTIME AND DEFINED IMAGESTEGO_ARCH)
    set(IMAGESTEGO_BINARY_DESTINATION "${IMAGESTEGO_ARCH}/${IMAGESTEGO_RUNTIME}/bin")
  else()
    set(IMAGESTEGO_BINARY_DESTINATION "")
  endif()
  if (IMAGESTEGO_STATIC)
    set(IMAGESTEGO_LIBRARY_DESTINATION "${IMAGESTEGO_ARCH}/${IMAGESTEGO_RUNTIME}/staticlib")
  else()
    set(IMAGESTEGO_LIBRARY_DESTINATION "${IMAGESTEGO_ARCH}/${IMAGESTEGO_RUNTIME}/lib")
  endif()
  set(IMAGESTEGO_ARCHIVE_DESTINATION ${IMAGESTEGO_LIBRARY_DESTINATION})
  set(IMAGESTEGO_CONFIG_DESTINATION ".")
  set(IMAGESTEGO_INCLUDE_DESTINATION "include")
else()
  include(GNUInstallDirs)
  set(IMAGESTEGO_BINARY_DESTINATION "bin")
  set(IMAGESTEGO_LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}")
  set(IMAGESTEGO_ARCHIVE_DESTINATION ${IMAGESTEGO_LIBRARY_DESTINATION})
  set(IMAGESTEGO_CONFIG_DESTINATION "${IMAGESTEGO_LIBRARY_DESTINATION}/cmake/imagestego")
  set(IMAGESTEGO_INCLUDE_DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
endif()

set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${IMAGESTEGO_LIBRARY_DESTINATION}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
