SET(PACKAGE_NAME "Mudlet")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../COPYING")
SET(CPACK_PACKAGE_EXECUTABLES "mudlet" "Mudlet")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mudlet")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Mudlet")
#SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/icons\\\\mudlet.bmp" )
SET(CPACK_CREATE_DESKTOP_LINKS "mudlet")
SET(CPACK_PACKAGE_VENDOR "Mudlet")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "0")
SET(CPACK_PACKAGE_VERSION_PATCH "1")

INSTALL(FILES LuaGlobal.lua DESTINATION bin)
INSTALL(FILES mudlet_documentation.html DESTINATION bin)

IF(WIN32 AND NOT UNIX)
  FIND_PACKAGE(MinGW REQUIRED)
  SET(CPACK_NSIS_INSTALLED_ICON_NAME "mudlet.exe")
  SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} Mudlet")
  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.mudlet.org")
  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.mudlet.org")
  SET(CPACK_NSIS_CONTACT "bruno@mudlet.org")
  
  INSTALL(PROGRAMS mudlet.exe DESTINATION bin)
  INSTALL(FILES ${QT_LIBRARY_DIR}/qscintilla2.dll DESTINATION bin)
  INSTALL(FILES ${QT_BINARY_DIR}/QtCore4.dll DESTINATION bin)
  INSTALL(FILES ${QT_BINARY_DIR}/QtGui4.dll DESTINATION bin)
  INSTALL(FILES ${QT_BINARY_DIR}/QtNetwork4.dll DESTINATION bin)
  INSTALL(FILES ${QT_BINARY_DIR}/QtWebKit4.dll DESTINATION bin)
  INSTALL(FILES ${LUA_INCLUDE_DIR}/lua51.dll DESTINATION bin)
  INSTALL(FILES ${CMAKE_MINGW_DLL} DESTINATION bin)
ELSE(WIN32 AND NOT UNIX)
  SET(CPACK_STRIP_FILES "mudlet")
  SET(CPACK_SOURCE_STRIP_FILES "")
ENDIF(WIN32 AND NOT UNIX)

INCLUDE(CPack)
INCLUDE(InstallRequiredSystemLibraries)