if(UNIX AND NOT APPLE)
  set(OS "linux")
elseif(APPLE)
  set(OS "mac-osx")
elseif(WIN32)
  set(OS "win32")
else()
  set(OS "Unknown-OS")
endif()

set(CPACK_PACKAGE_FILE_NAME "XtalOpt-${XtalOpt_VERSION_FULL}-${OS}")
set(CPACK_PACKAGE_VERSION_MAJOR ${XtalOpt_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${XtalOpt_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${XtalOpt_VERSION_PATCH})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "XtalOpt")
set(CPACK_PACKAGE_VENDOR "Zurek Lab")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
set(CPACK_CREATE_DESKTOP_LINKS "xtalopt")
set(CPACK_PACKAGE_EXECUTABLES "xtalopt" "XtalOpt")

# NSIS stuff
set(CPACK_NSIS_HELP_LINK "https:\\\\xtalopt.github.io")
set(CPACK_NSIS_URL_INFO_ABOUT "https:\\\\xtalopt.github.io")
set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\xtalopt.exe")
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/src/xtalopt/images\\\\xtalopt-logo.ico")
set(CPACK_PACKAGE_ICON  "${CMAKE_SOURCE_DIR}/src/xtalopt/images\\\\xtalopt-logo.png")
set(CPACK_NSIS_MODIFY_PATH ON)

include(CPack)
include(InstallRequiredSystemLibraries)
