Commits

Shlomi Fish committed e89bc86

CPack-enabled the distribution.

  • Participants
  • Parent commits ff1c4a9
  • Branches conversion-to-cmake

Comments (0)

Files changed (2)

File src/CMakeLists.txt

 
 INCLUDE ("Common.cmake")
 
+# This is the equivalent to perform a "make dist"/"make distdir" etc.
+SET(CPACK_PACKAGE_NAME "wml")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Website Meta Language")
+SET(CPACK_PACKAGE_VENDOR "Shlomi Fish")
+SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
+SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
+
+# Process and extract the version number.
+# FILE( READ "ver.txt" VERSION)
+
+CHOMP (VERSION)
+
+STRING (REGEX MATCHALL "([0-9]+)" VERSION_DIGITS "${VERSION}")
+
+LIST(GET VERSION_DIGITS 0 CPACK_PACKAGE_VERSION_MAJOR)
+LIST(GET VERSION_DIGITS 1 CPACK_PACKAGE_VERSION_MINOR)
+LIST(GET VERSION_DIGITS 2 CPACK_PACKAGE_VERSION_PATCH)
+
+SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY} ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+
+SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+
+SET (base_with_ver "${CPACK_PACKAGE_NAME}-[0-9]+\\\\.[0-9]+\\\\.[0-9]+")
+
+SET(CPACK_SOURCE_IGNORE_FILES
+    "/build/"
+    "/_CPack_Packages/"
+    "/CMakeFiles/"
+    "/.deps/"
+    "^${base_with_ver}(-Source|-Linux)?/"
+    "${base_with_ver}.tar\\\\.(gz|bz2|Z|lzma|xz)$"
+    "\\\\.o$"
+    "~$"
+    "\\\\.so(\\\\.[0-9]+)*$"
+    "/\\\\.svn/"
+    "\\\\.(pdf|fo)$"
+    "/t/t/.*\\\\.exe$"
+    "/t/Presets"
+    "/CMakeCache\\\\.txt$"
+    "/Makefile$"
+    "/tags$"
+    "/([0-9]+)\\\\.board$"
+    "/config\\\\.h$"
+    "ids-whitelist\\\\.txt"
+)
+
+IF(WIN32 AND NOT UNIX)
+    # There is a bug in NSI that does not handle full unix paths properly. Make
+    # sure there is at least one set of four (4) backlasshes.
+    # SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}\\\\dondorf-king.bmp")
+    SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\wml.exe")
+    SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\thewml.org")
+    SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\thewml.org")
+    SET(CPACK_NSIS_DISPLAY_NAME "Website Meta Language")
+    SET(CPACK_NSIS_CONTACT "shlomif@cpan.org")
+    SET(CPACK_NSIS_MODIFY_PATH ON)
+    # Setting for NSIS :
+    SET(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\wml.ico")
+    SET(CPACK_NSIS_MUI_UNIICON ${CPACK_NSIS_MUI_ICON})
+    SET(CPACK_PACKAGE_ICON ${CPACK_NSIS_MUI_ICON})
+    SET(CPACK_NSIS_MODIFY_PATH "ON")
+ELSE(WIN32 AND NOT UNIX)
+    # SET(CPACK_STRIP_FILES "")
+    # SET(CPACK_SOURCE_STRIP_FILES "")
+ENDIF(WIN32 AND NOT UNIX)
+
+SET(CPACK_PACKAGE_EXECUTABLES
+    "wml" "Website Meta Language Frontend"
+)
+
+INCLUDE (CPack)
+
 SUBDIRS (
     wml_aux 
     wml_backend  

File src/Common.cmake

         RENAME "${DEST_BASENAME}"
     )    
 ENDMACRO(DEFINE_WML_PERL_BACKEND)
+
+MACRO(CHOMP VAR)
+    STRING(REGEX REPLACE "[\r\n]+$" "" ${VAR} "${${VAR}}")
+ENDMACRO(CHOMP)