2010-08-11 James Hawkins <jhawkins@chromium.org>
[WebKit-https.git] / 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     "/PlanetWebKit/"
40     "/SunSpider/"
41     "/WebKitExamplePlugins/"
42     "/WebKitSite/"
43     "/BugsSite/"
44
45     # Other build systems:
46     # - Makefiles (.mk/Makefile)
47     "\\\\.mk$"
48     "\\\\.make$"
49     "Makefile"
50     # - Autotools (GTK)
51     "/autotools/"
52     "/configure\\\\.ac"
53     "/autogen\\\\.sh"
54     "/autom4te\\\\.cache/"
55     "/aclocal\\\\.m4$"
56     "/GNUmakefile"
57     "/GNUmakefile"
58     # - XCode (Mac)
59     "\\\\.xcodeproj"
60     "\\\\.xcconfig"
61     # - GYP
62     "\\\\.gyp"
63     # - QMake (Qt)
64     "\\\\.pri$"
65     "\\\\.pro$"
66
67     # Development & Runtime created files
68     "~$"
69     "\\\\.mode"
70     "\\\\.pbxuser$"
71     "\\\\.perspective"
72     "\\\\.pyc$"
73     "\\\\.pyo$"
74     "/cmake-build/"
75     "/build/"
76     "/WebKitBuild/"
77     "/WebKitTools/Scripts/webkitpy/thirdparty/autoinstalled/"
78     )
79
80   IF(NOT WEBKIT_CPACK_ADD_TESTS)
81     LIST(APPEND CPACK_SOURCE_IGNORE_FILES
82       "/LayoutTests/"
83       "/manual-tests/"
84       "/tests/"
85       "/PageLoadTests/"
86       )
87   ENDIF(NOT WEBKIT_CPACK_ADD_TESTS)
88
89   IF(NOT WEBKIT_CPACK_ADD_TOOLS)
90     LIST(APPEND CPACK_SOURCE_IGNORE_FILES
91       "/WebKitTools/"
92       "/manual-tools/"
93       "/tools/"
94       "/PageLoadTools/"
95       )
96   ENDIF(NOT WEBKIT_CPACK_ADD_TOOLS)
97
98
99   IF(NOT WEBKIT_CPACK_ALL_PORTS)
100
101     # All file and directory patterns that Efl uses
102     SET(FILE_PATTERNS_Efl
103       "/cairo/" "/Cairo/" "cairo\\\\." "Cairo\\\\."
104       "/efl/" "/Efl/" "efl\\\\." "Efl\\\\."
105       "/glib/" "/Glib/" "glib\\\\." "Glib\\\\."
106       "/gobject/" "/Gobject/" "gobject\\\\." "Gobject\\\\."
107       "/icu/" "/Icu/" "icu\\\\." "Icu\\\\."
108       "/posix/" "/Posix/" "posix\\\\." "Posix\\\\."
109       "/soup/" "/Soup/" "soup\\\\." "Soup\\\\."
110       )
111
112     # File and Directory patterns that no CMake-ified port uses
113     SET(FILE_PATTERNS_UNKNOWN_PORTS
114       "/android/" "/Android/" "android\\\\." "Android\\\\."
115       "/brew/" "/Brew/" "brew\\\\." "Brew\\\\."
116       "/carbon/" "/Carbon/" "carbon\\\\." "Carbon\\\\."
117       "/cf/" "/Cf/" "cf\\\\." "Cf\\\\."
118       "/cg/" "/Cg/" "cg\\\\." "Cg\\\\."
119       "/chromium/" "/Chromium/" "chromium\\\\." "Chromium\\\\."
120       "/cocoa/" "/Cocoa/" "cocoa\\\\." "Cocoa\\\\."
121       "/Configurations/" "/Configurations/" "Configurations\\\\." "Configurations\\\\."
122       "/curl/" "/Curl/" "curl\\\\." "Curl\\\\."
123       "/gstreamer/" "/Gstreamer/" "gstreamer\\\\." "Gstreamer\\\\."
124       "/gtk/" "/Gtk/" "gtk\\\\." "Gtk\\\\."
125       "/haiku/" "/Haiku/" "haiku\\\\." "Haiku\\\\."
126       "/iphone/" "/Iphone/" "iphone\\\\." "Iphone\\\\."
127       "/mac/" "/Mac/" "mac\\\\." "Mac\\\\."
128       "/opentype/" "/Opentype/" "opentype\\\\." "Opentype\\\\."
129       "/openvg/" "/Openvg/" "openvg\\\\." "Openvg\\\\."
130       "/os-win32/" "/Os-Win32/" "os-win32\\\\." "Os-Win32\\\\."
131       "/qscriptengine/" "/Qscriptengine/" "qscriptengine\\\\." "Qscriptengine\\\\."
132       "/qscriptstring/" "/Qscriptstring/" "qscriptstring\\\\." "Qscriptstring\\\\."
133       "/qscriptvalue/" "/Qscriptvalue/" "qscriptvalue\\\\." "Qscriptvalue\\\\."
134       "/qt/" "/Qt/" "qt\\\\." "Qt\\\\."
135       "/qt4/" "/Qt4/" "qt4\\\\." "Qt4\\\\."
136       "/skia/" "/Skia/" "skia\\\\." "Skia\\\\."
137       "/symbian/" "/Symbian/" "symbian\\\\." "Symbian\\\\."
138       "/v8/" "/V8/" "v8\\\\." "V8\\\\."
139       "/V8/" "/V8/" "V8\\\\." "V8\\\\."
140       "/win/" "/Win/" "win\\\\." "Win\\\\."
141       "/wince/" "/Wince/" "wince\\\\." "Wince\\\\."
142       "/wx/" "/Wx/" "wx\\\\." "Wx\\\\."
143       "/wxcode/" "/Wxcode/" "wxcode\\\\." "Wxcode\\\\."
144       "/WebKitLibraries/"
145       "/English\\\\.lproj/"
146       "/WebKit2/"
147       "\\\\.a$"
148       "\\\\.exe$"
149       "\\\\.mm$"
150       )
151
152     # Append all Unknown port patterns
153     FOREACH(_pattern ${FILE_PATTERNS_UNKNOWN_PORTS})
154       LIST(FIND FILE_PATTERNS_${PORT} ${_pattern} _pattern_index)
155       IF(_pattern_index GREATER -1)
156         MESSAGE("pattern ${_pattern} declared of 'no-port' is actually used by ${PORT}")
157       ELSE()
158         LIST(APPEND CPACK_SOURCE_IGNORE_FILES ${_pattern})
159       ENDIF()
160     ENDFOREACH()
161
162     # Append all "other-ports" patterns
163     FOREACH(_port ${ALL_PORTS})
164       IF(NOT ${_port} STREQUAL ${PORT})
165         FOREACH(_pattern ${FILE_PATTERNS_${_port}})
166
167           LIST(FIND FILE_PATTERNS_${PORT} ${_pattern} _pattern_index)
168           IF(_pattern_index GREATER -1)
169             MESSAGE("pattern ${_pattern} of port ${_port} is also used by ${PORT}")
170           ELSE()
171             LIST(APPEND CPACK_SOURCE_IGNORE_FILES ${_pattern})
172           ENDIF()
173         ENDFOREACH()
174       ENDIF()
175     ENDFOREACH()
176
177   ENDIF(NOT WEBKIT_CPACK_ALL_PORTS)
178
179 ENDIF(NOT DEFINED CPACK_SOURCE_IGNORE_FILES)
180
181 # -----------------------------------------------------------------------------
182 # Include CPack that will define targets based on the variables defined before
183 # -----------------------------------------------------------------------------
184 INCLUDE(CPack)