Prepare to move manual-tests out of WebCore
[WebKit-https.git] / 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       "/ManualTests/"
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       "/carbon/" "/Carbon/" "carbon\\\\." "Carbon\\\\."
112       "/cf/" "/Cf/" "cf\\\\." "Cf\\\\."
113       "/cg/" "/Cg/" "cg\\\\." "Cg\\\\."
114       "/chromium/" "/Chromium/" "chromium\\\\." "Chromium\\\\."
115       "/cocoa/" "/Cocoa/" "cocoa\\\\." "Cocoa\\\\."
116       "/Configurations/" "/Configurations/" "Configurations\\\\." "Configurations\\\\."
117       "/curl/" "/Curl/" "curl\\\\." "Curl\\\\."
118       "/gstreamer/" "/Gstreamer/" "gstreamer\\\\." "Gstreamer\\\\."
119       "/gtk/" "/Gtk/" "gtk\\\\." "Gtk\\\\."
120       "/iphone/" "/Iphone/" "iphone\\\\." "Iphone\\\\."
121       "/mac/" "/Mac/" "mac\\\\." "Mac\\\\."
122       "/opentype/" "/Opentype/" "opentype\\\\." "Opentype\\\\."
123       "/openvg/" "/Openvg/" "openvg\\\\." "Openvg\\\\."
124       "/os-win32/" "/Os-Win32/" "os-win32\\\\." "Os-Win32\\\\."
125       "/qscriptengine/" "/Qscriptengine/" "qscriptengine\\\\." "Qscriptengine\\\\."
126       "/qscriptstring/" "/Qscriptstring/" "qscriptstring\\\\." "Qscriptstring\\\\."
127       "/qscriptvalue/" "/Qscriptvalue/" "qscriptvalue\\\\." "Qscriptvalue\\\\."
128       "/qt/" "/Qt/" "qt\\\\." "Qt\\\\."
129       "/qt4/" "/Qt4/" "qt4\\\\." "Qt4\\\\."
130       "/skia/" "/Skia/" "skia\\\\." "Skia\\\\."
131       "/symbian/" "/Symbian/" "symbian\\\\." "Symbian\\\\."
132       "/v8/" "/V8/" "v8\\\\." "V8\\\\."
133       "/V8/" "/V8/" "V8\\\\." "V8\\\\."
134       "/win/" "/Win/" "win\\\\." "Win\\\\."
135       "/wince/" "/Wince/" "wince\\\\." "Wince\\\\."
136       "/wx/" "/Wx/" "wx\\\\." "Wx\\\\."
137       "/wxcode/" "/Wxcode/" "wxcode\\\\." "Wxcode\\\\."
138       "/WebKitLibraries/"
139       "/English\\\\.lproj/"
140       "/Source/WebKit2/"
141       "\\\\.a$"
142       "\\\\.exe$"
143       "\\\\.mm$"
144       )
145
146     # Append all Unknown port patterns
147     FOREACH(_pattern ${FILE_PATTERNS_UNKNOWN_PORTS})
148       LIST(FIND FILE_PATTERNS_${PORT} ${_pattern} _pattern_index)
149       IF(_pattern_index GREATER -1)
150         MESSAGE("pattern ${_pattern} declared of 'no-port' is actually used by ${PORT}")
151       ELSE()
152         LIST(APPEND CPACK_SOURCE_IGNORE_FILES ${_pattern})
153       ENDIF()
154     ENDFOREACH()
155
156     # Append all "other-ports" patterns
157     FOREACH(_port ${ALL_PORTS})
158       IF(NOT ${_port} STREQUAL ${PORT})
159         FOREACH(_pattern ${FILE_PATTERNS_${_port}})
160
161           LIST(FIND FILE_PATTERNS_${PORT} ${_pattern} _pattern_index)
162           IF(_pattern_index GREATER -1)
163             MESSAGE("pattern ${_pattern} of port ${_port} is also used by ${PORT}")
164           ELSE()
165             LIST(APPEND CPACK_SOURCE_IGNORE_FILES ${_pattern})
166           ENDIF()
167         ENDFOREACH()
168       ENDIF()
169     ENDFOREACH()
170
171   ENDIF(NOT WEBKIT_CPACK_ALL_PORTS)
172
173 ENDIF(NOT DEFINED CPACK_SOURCE_IGNORE_FILES)
174
175 # -----------------------------------------------------------------------------
176 # Include CPack that will define targets based on the variables defined before
177 # -----------------------------------------------------------------------------
178 INCLUDE(CPack)