Removed old stdbool and inttypes headers.
[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         # - XCode (Mac)
49         "\\\\.xcodeproj"
50         "\\\\.xcconfig"
51         # - GYP
52         "\\\\.gyp"
53         # - QMake (Qt)
54         "\\\\.pri$"
55         "\\\\.pro$"
56
57         # Development & Runtime created files
58         "~$"
59         "\\\\.mode"
60         "\\\\.pbxuser$"
61         "\\\\.perspective"
62         "\\\\.pyc$"
63         "\\\\.pyo$"
64         "/cmake-build/"
65         "/build/"
66         "/WebKitBuild/"
67         "/Tools/Scripts/webkitpy/thirdparty/autoinstalled/"
68         )
69
70     if (NOT WEBKIT_CPACK_ADD_TESTS)
71         list(APPEND CPACK_SOURCE_IGNORE_FILES
72           "/LayoutTests/"
73           "/ManualTests/"
74           "/tests/"
75           )
76     endif (NOT WEBKIT_CPACK_ADD_TESTS)
77
78     if (NOT WEBKIT_CPACK_ADD_TOOLS)
79         list(APPEND CPACK_SOURCE_IGNORE_FILES
80         "/Tools/"
81         "/manual-tools/"
82         "/tools/"
83         "/PageLoadTools/"
84         )
85     endif (NOT WEBKIT_CPACK_ADD_TOOLS)
86
87
88     if (NOT WEBKIT_CPACK_ALL_PORTS)
89
90         # All file and directory patterns that Efl uses
91         set(FILE_PATTERNS_Efl
92             "/cairo/" "/Cairo/" "cairo\\\\." "Cairo\\\\."
93             "/efl/" "/Efl/" "efl\\\\." "Efl\\\\."
94             "/glib/" "/Glib/" "glib\\\\." "Glib\\\\."
95             "/gobject/" "/Gobject/" "gobject\\\\." "Gobject\\\\."
96             "/icu/" "/Icu/" "icu\\\\." "Icu\\\\."
97             "/posix/" "/Posix/" "posix\\\\." "Posix\\\\."
98             "/soup/" "/Soup/" "soup\\\\." "Soup\\\\."
99             )
100
101         # File and Directory patterns that no CMake-ified port uses
102         set(FILE_PATTERNS_UNKNOWN_PORTS
103             "/carbon/" "/Carbon/" "carbon\\\\." "Carbon\\\\."
104             "/cf/" "/Cf/" "cf\\\\." "Cf\\\\."
105             "/cg/" "/Cg/" "cg\\\\." "Cg\\\\."
106             "/chromium/" "/Chromium/" "chromium\\\\." "Chromium\\\\."
107             "/cocoa/" "/Cocoa/" "cocoa\\\\." "Cocoa\\\\."
108             "/Configurations/" "/Configurations/" "Configurations\\\\." "Configurations\\\\."
109             "/curl/" "/Curl/" "curl\\\\." "Curl\\\\."
110             "/gstreamer/" "/Gstreamer/" "gstreamer\\\\." "Gstreamer\\\\."
111             "/gtk/" "/Gtk/" "gtk\\\\." "Gtk\\\\."
112             "/iphone/" "/Iphone/" "iphone\\\\." "Iphone\\\\."
113             "/mac/" "/Mac/" "mac\\\\." "Mac\\\\."
114             "/opentype/" "/Opentype/" "opentype\\\\." "Opentype\\\\."
115             "/openvg/" "/Openvg/" "openvg\\\\." "Openvg\\\\."
116             "/qscriptengine/" "/Qscriptengine/" "qscriptengine\\\\." "Qscriptengine\\\\."
117             "/qscriptstring/" "/Qscriptstring/" "qscriptstring\\\\." "Qscriptstring\\\\."
118             "/qscriptvalue/" "/Qscriptvalue/" "qscriptvalue\\\\." "Qscriptvalue\\\\."
119             "/qt/" "/Qt/" "qt\\\\." "Qt\\\\."
120             "/qt4/" "/Qt4/" "qt4\\\\." "Qt4\\\\."
121             "/win/" "/Win/" "win\\\\." "Win\\\\."
122             "/wince/" "/Wince/" "wince\\\\." "Wince\\\\."
123             "/wxcode/" "/Wxcode/" "wxcode\\\\." "Wxcode\\\\."
124             "/WebKitLibraries/"
125             "/English\\\\.lproj/"
126             "/Source/WebKit2/"
127             "\\\\.a$"
128             "\\\\.exe$"
129             "\\\\.mm$"
130             )
131
132         # Append all Unknown port patterns
133         foreach (_pattern ${FILE_PATTERNS_UNKNOWN_PORTS})
134             list(FIND FILE_PATTERNS_${PORT} ${_pattern} _pattern_index)
135             if (_pattern_index GREATER -1)
136                 message("pattern ${_pattern} declared of 'no-port' is actually used by ${PORT}")
137             else ()
138                 list(APPEND CPACK_SOURCE_IGNORE_FILES ${_pattern})
139             endif ()
140         endforeach ()
141
142         # Append all "other-ports" patterns
143         foreach (_port ${ALL_PORTS})
144             if (NOT ${_port} STREQUAL ${PORT})
145                 foreach (_pattern ${FILE_PATTERNS_${_port}})
146
147                     list(FIND FILE_PATTERNS_${PORT} ${_pattern} _pattern_index)
148                     if (_pattern_index GREATER -1)
149                         message("pattern ${_pattern} of port ${_port} is also used by ${PORT}")
150                     else ()
151                         list(APPEND CPACK_SOURCE_IGNORE_FILES ${_pattern})
152                     endif ()
153                 endforeach ()
154             endif ()
155         endforeach ()
156
157     endif (NOT WEBKIT_CPACK_ALL_PORTS)
158
159 endif (NOT DEFINED CPACK_SOURCE_IGNORE_FILES)
160
161 # -----------------------------------------------------------------------------
162 # Include CPack that will define targets based on the variables defined before
163 # -----------------------------------------------------------------------------
164 include(CPack)