initial import
[vuplus_webkit] / Source / cmake / WebKitPackaging.cmake
1 # -----------------------------------------------------------------------------
2 # This file defines the basics of CPack behavior for WebKit
3 #
4 # The following CPack variables will be defined if they were unset:
5 #   - CPACK_PACKAGE_NAME to WebKit-${PORT}
6 #   - CPACK_SOURCE_IGNORE_FILES to a known pattern of good files
7 #
8 # The following variables affect the behavior of packaging:
9 #   - WEBKIT_CPACK_ALL_PORTS if defined and true, will not limit packaging
10 #     to just include files of the port (affects CPACK_SOURCE_IGNORE_FILES,
11 #     just if this variable was not defined before).
12 #   - WEBKIT_CPACK_ADD_TESTS if defined and true, will also add tests
13 #     (affects CPACK_SOURCE_IGNORE_FILES, just if this variable was
14 #     not defined before)
15 #   - WEBKIT_CPACK_ADD_TOOLS if defined and true, will also add tools
16 #     (affects CPACK_SOURCE_IGNORE_FILES, just if this variable was
17 #     not defined before)
18 # -----------------------------------------------------------------------------
19
20 IF(NOT DEFINED CPACK_PACKAGE_NAME)
21   SET(CPACK_PACKAGE_NAME WebKit-${PORT})
22 ENDIF()
23
24 IF(NOT DEFINED CPACK_SOURCE_IGNORE_FILES)
25   SET(CPACK_SOURCE_IGNORE_FILES
26     # Version control:
27     "/CVS/"
28     "/\\\\.svn/"
29     "/\\\\.bzr/"
30     "/\\\\.hg/"
31     "/\\\\.git/"
32     "\\\\.swp$"
33     "\\\\.#"
34     "/#"
35     "/\\\\.gitignore$"
36     "/\\\\.gitattributes$"
37
38     # SVN-only files should be ignored (site, examples...)
39     "/PerformanceTests/"
40     "/Examples/"
41     "/Websites/"
42
43     # Other build systems:
44     # - Makefiles (.mk/Makefile)
45     "\\\\.mk$"
46     "\\\\.make$"
47     "Makefile"
48     # - Autotools (GTK)
49     "/autotools/"
50     "/configure\\\\.ac"
51     "/autogen\\\\.sh"
52     "/autom4te\\\\.cache/"
53     "/aclocal\\\\.m4$"
54     "/GNUmakefile"
55     "/GNUmakefile"
56     # - XCode (Mac)
57     "\\\\.xcodeproj"
58     "\\\\.xcconfig"
59     # - GYP
60     "\\\\.gyp"
61     # - QMake (Qt)
62     "\\\\.pri$"
63     "\\\\.pro$"
64
65     # Development & Runtime created files
66     "~$"
67     "\\\\.mode"
68     "\\\\.pbxuser$"
69     "\\\\.perspective"
70     "\\\\.pyc$"
71     "\\\\.pyo$"
72     "/cmake-build/"
73     "/build/"
74     "/WebKitBuild/"
75     "/Tools/Scripts/webkitpy/thirdparty/autoinstalled/"
76     )
77
78   IF(NOT WEBKIT_CPACK_ADD_TESTS)
79     LIST(APPEND CPACK_SOURCE_IGNORE_FILES
80       "/LayoutTests/"
81       "/manual-tests/"
82       "/tests/"
83       )
84   ENDIF(NOT WEBKIT_CPACK_ADD_TESTS)
85
86   IF(NOT WEBKIT_CPACK_ADD_TOOLS)
87     LIST(APPEND CPACK_SOURCE_IGNORE_FILES
88       "/Tools/"
89       "/manual-tools/"
90       "/tools/"
91       "/PageLoadTools/"
92       )
93   ENDIF(NOT WEBKIT_CPACK_ADD_TOOLS)
94
95
96   IF(NOT WEBKIT_CPACK_ALL_PORTS)
97
98     # All file and directory patterns that Efl uses
99     SET(FILE_PATTERNS_Efl
100       "/cairo/" "/Cairo/" "cairo\\\\." "Cairo\\\\."
101       "/efl/" "/Efl/" "efl\\\\." "Efl\\\\."
102       "/glib/" "/Glib/" "glib\\\\." "Glib\\\\."
103       "/gobject/" "/Gobject/" "gobject\\\\." "Gobject\\\\."
104       "/icu/" "/Icu/" "icu\\\\." "Icu\\\\."
105       "/posix/" "/Posix/" "posix\\\\." "Posix\\\\."
106       "/soup/" "/Soup/" "soup\\\\." "Soup\\\\."
107       )
108
109     # File and Directory patterns that no CMake-ified port uses
110     SET(FILE_PATTERNS_UNKNOWN_PORTS
111       "/brew/" "/Brew/" "brew\\\\." "Brew\\\\."
112       "/carbon/" "/Carbon/" "carbon\\\\." "Carbon\\\\."
113       "/cf/" "/Cf/" "cf\\\\." "Cf\\\\."
114       "/cg/" "/Cg/" "cg\\\\." "Cg\\\\."
115       "/chromium/" "/Chromium/" "chromium\\\\." "Chromium\\\\."
116       "/cocoa/" "/Cocoa/" "cocoa\\\\." "Cocoa\\\\."
117       "/Configurations/" "/Configurations/" "Configurations\\\\." "Configurations\\\\."
118       "/curl/" "/Curl/" "curl\\\\." "Curl\\\\."
119       "/gstreamer/" "/Gstreamer/" "gstreamer\\\\." "Gstreamer\\\\."
120       "/gtk/" "/Gtk/" "gtk\\\\." "Gtk\\\\."
121       "/haiku/" "/Haiku/" "haiku\\\\." "Haiku\\\\."
122       "/iphone/" "/Iphone/" "iphone\\\\." "Iphone\\\\."
123       "/mac/" "/Mac/" "mac\\\\." "Mac\\\\."
124       "/opentype/" "/Opentype/" "opentype\\\\." "Opentype\\\\."
125       "/openvg/" "/Openvg/" "openvg\\\\." "Openvg\\\\."
126       "/os-win32/" "/Os-Win32/" "os-win32\\\\." "Os-Win32\\\\."
127       "/qscriptengine/" "/Qscriptengine/" "qscriptengine\\\\." "Qscriptengine\\\\."
128       "/qscriptstring/" "/Qscriptstring/" "qscriptstring\\\\." "Qscriptstring\\\\."
129       "/qscriptvalue/" "/Qscriptvalue/" "qscriptvalue\\\\." "Qscriptvalue\\\\."
130       "/qt/" "/Qt/" "qt\\\\." "Qt\\\\."
131       "/qt4/" "/Qt4/" "qt4\\\\." "Qt4\\\\."
132       "/skia/" "/Skia/" "skia\\\\." "Skia\\\\."
133       "/symbian/" "/Symbian/" "symbian\\\\." "Symbian\\\\."
134       "/v8/" "/V8/" "v8\\\\." "V8\\\\."
135       "/V8/" "/V8/" "V8\\\\." "V8\\\\."
136       "/win/" "/Win/" "win\\\\." "Win\\\\."
137       "/wince/" "/Wince/" "wince\\\\." "Wince\\\\."
138       "/wx/" "/Wx/" "wx\\\\." "Wx\\\\."
139       "/wxcode/" "/Wxcode/" "wxcode\\\\." "Wxcode\\\\."
140       "/WebKitLibraries/"
141       "/English\\\\.lproj/"
142       "/Source/WebKit2/"
143       "\\\\.a$"
144       "\\\\.exe$"
145       "\\\\.mm$"
146       )
147
148     # Append all Unknown port patterns
149     FOREACH(_pattern ${FILE_PATTERNS_UNKNOWN_PORTS})
150       LIST(FIND FILE_PATTERNS_${PORT} ${_pattern} _pattern_index)
151       IF(_pattern_index GREATER -1)
152         MESSAGE("pattern ${_pattern} declared of 'no-port' is actually used by ${PORT}")
153       ELSE()
154         LIST(APPEND CPACK_SOURCE_IGNORE_FILES ${_pattern})
155       ENDIF()
156     ENDFOREACH()
157
158     # Append all "other-ports" patterns
159     FOREACH(_port ${ALL_PORTS})
160       IF(NOT ${_port} STREQUAL ${PORT})
161         FOREACH(_pattern ${FILE_PATTERNS_${_port}})
162
163           LIST(FIND FILE_PATTERNS_${PORT} ${_pattern} _pattern_index)
164           IF(_pattern_index GREATER -1)
165             MESSAGE("pattern ${_pattern} of port ${_port} is also used by ${PORT}")
166           ELSE()
167             LIST(APPEND CPACK_SOURCE_IGNORE_FILES ${_pattern})
168           ENDIF()
169         ENDFOREACH()
170       ENDIF()
171     ENDFOREACH()
172
173   ENDIF(NOT WEBKIT_CPACK_ALL_PORTS)
174
175 ENDIF(NOT DEFINED CPACK_SOURCE_IGNORE_FILES)
176
177 # -----------------------------------------------------------------------------
178 # Include CPack that will define targets based on the variables defined before
179 # -----------------------------------------------------------------------------
180 INCLUDE(CPack)