CMakeLists.txt 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/nsis_branding.bmp")
  2. SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/icon.ico")
  3. SET(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe" PARENT_SCOPE)
  4. SET(CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME_UCASE} ${VERSION}" PARENT_SCOPE)
  5. SET(CPACK_NSIS_HELP_LINK "${PROJECT_URL}" PARENT_SCOPE)
  6. SET(CPACK_NSIS_URL_INFO_ABOUT "${PROJECT_URL}" PARENT_SCOPE)
  7. SET(CPACK_NSIS_CONTACT "${PROJECT_EMAIL}" PARENT_SCOPE)
  8. SET(CPACK_PACKAGE_EXECUTABLES "${CMAKE_PROJECT_NAME}.exe;${PROJECT_NAME_UCASE}" PARENT_SCOPE)
  9. SET(CPACK_NSIS_MENU_LINKS "${CMAKE_PROJECT_NAME}.exe;${PROJECT_NAME_UCASE}" PARENT_SCOPE)
  10. SET(CPACK_NSIS_DEFINES "
  11. !include ${CMAKE_SOURCE_DIR}/cmake/nsis/FileAssociation.nsh
  12. !include LogicLib.nsh
  13. !include WinVer.nsh")
  14. SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}-win32")
  15. SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
  16. \\\${registerExtension} \\\"$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe\\\" \\\".mmp\\\" \\\"${PROJECT_NAME_UCASE} Project\\\"
  17. \\\${registerExtension} \\\"$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe\\\" \\\".mmpz\\\" \\\"${PROJECT_NAME_UCASE} Project (compressed)\\\"
  18. \\\${IfNot} \\\${AtMostWin7}
  19. WriteRegDWORD HKLM \\\"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\SideBySide\\\" \\\"PreferExternalManifest\\\" \\\"1\\\"
  20. \\\${EndIf}
  21. " PARENT_SCOPE)
  22. SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
  23. \\\${unregisterExtension} \\\".mmp\\\" \\\"${PROJECT_NAME_UCASE} Project\\\"
  24. \\\${unregisterExtension} \\\".mmpz\\\" \\\"${PROJECT_NAME_UCASE} Project (compressed)\\\"
  25. DeleteRegKey HKCR \\\"${PROJECT_NAME_UCASE} Project\\\"
  26. DeleteRegKey HKCR \\\"${PROJECT_NAME_UCASE} Project (compressed)\\\"
  27. " PARENT_SCOPE)
  28. IF(WIN64)
  29. SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}-win64")
  30. SET(CPACK_INSTALL_FIX "$PROGRAMFILES64\\\\${CPACK_PACKAGE_INSTALL_DIRECTORY}\\\\")
  31. SET(CPACK_NSIS_DEFINES "
  32. ${CPACK_NSIS_DEFINES}
  33. InstallDir ${CPACK_INSTALL_FIX}
  34. ")
  35. ENDIF()
  36. # Fix windows paths for msys
  37. IF(LMMS_BUILD_MSYS)
  38. STRING(REGEX REPLACE "/" "\\\\\\\\" CPACK_PACKAGE_ICON "${CPACK_PACKAGE_ICON}")
  39. STRING(REGEX REPLACE "/" "\\\\\\\\" CPACK_NSIS_MUI_ICON "${CPACK_NSIS_MUI_ICON}")
  40. STRING(REGEX REPLACE "/" "\\\\\\\\" CPACK_NSIS_DEFINES "${CPACK_NSIS_DEFINES}")
  41. STRING(REGEX REPLACE "/" "\\\\\\\\" CMAKE_BINARY_DIR_FIX "${CMAKE_BINARY_DIR}")
  42. # FIXME: there's no easy way to fix $INST_DIR, so we'll redefine it manually
  43. IF(WIN64)
  44. SET(NSIS_ARCH "win64")
  45. ELSE()
  46. SET(NSIS_ARCH "win32")
  47. ENDIF()
  48. SET(CPACK_NSIS_DEFINES "
  49. ${CPACK_NSIS_DEFINES}
  50. !define /redef INST_DIR ${CMAKE_BINARY_DIR_FIX}\\\\_CPack_Packages\\\\${NSIS_ARCH}\\\\NSIS\\\\${CPACK_PACKAGE_FILE_NAME}
  51. ")
  52. ENDIF()
  53. # Setup missing parent scopes
  54. SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}" PARENT_SCOPE)
  55. SET(CPACK_NSIS_DEFINES "${CPACK_NSIS_DEFINES}" PARENT_SCOPE)
  56. SET(CPACK_PACKAGE_ICON "${CPACK_PACKAGE_ICON}" PARENT_SCOPE)
  57. SET(CPACK_NSIS_MUI_ICON "${CPACK_NSIS_MUI_ICON}" PARENT_SCOPE)
  58. # Windows resource compilers
  59. CONFIGURE_FILE("lmms.rc.in" "${CMAKE_BINARY_DIR}/lmms.rc")
  60. CONFIGURE_FILE("zynaddsubfx.rc.in" "${CMAKE_BINARY_DIR}/plugins/zynaddsubfx/zynaddsubfx.rc")
  61. IF(LMMS_HAVE_STK)
  62. FILE(GLOB RAWWAVES "${MINGW_PREFIX}/share/stk/rawwaves/*.raw")
  63. LIST(SORT RAWWAVES)
  64. INSTALL(FILES ${RAWWAVES} DESTINATION "${DATA_DIR}/stk/rawwaves")
  65. ENDIF()
  66. INSTALL(FILES "lmms.exe.manifest" DESTINATION .)
  67. INSTALL(FILES "lmms.VisualElementsManifest.xml" DESTINATION .)
  68. INSTALL(DIRECTORY "assets" DESTINATION .)