Fix compiler warnings when building with GCC 7
[WebKit.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         # File and Directory patterns that no CMake-ified port uses
90         set(FILE_PATTERNS_UNKNOWN_PORTS
91             "/carbon/" "/Carbon/" "carbon\\\\." "Carbon\\\\."
92             "/cf/" "/Cf/" "cf\\\\." "Cf\\\\."
93             "/cg/" "/Cg/" "cg\\\\." "Cg\\\\."
94             "/chromium/" "/Chromium/" "chromium\\\\." "Chromium\\\\."
95             "/cocoa/" "/Cocoa/" "cocoa\\\\." "Cocoa\\\\."
96             "/Configurations/" "/Configurations/" "Configurations\\\\." "Configurations\\\\."
97             "/curl/" "/Curl/" "curl\\\\." "Curl\\\\."
98             "/gstreamer/" "/Gstreamer/" "gstreamer\\\\." "Gstreamer\\\\."
99             "/gtk/" "/Gtk/" "gtk\\\\." "Gtk\\\\."
100             "/iphone/" "/Iphone/" "iphone\\\\." "Iphone\\\\."
101             "/mac/" "/Mac/" "mac\\\\." "Mac\\\\."
102             "/opentype/" "/Opentype/" "opentype\\\\." "Opentype\\\\."
103             "/openvg/" "/Openvg/" "openvg\\\\." "Openvg\\\\."
104             "/qscriptengine/" "/Qscriptengine/" "qscriptengine\\\\." "Qscriptengine\\\\."
105             "/qscriptstring/" "/Qscriptstring/" "qscriptstring\\\\." "Qscriptstring\\\\."
106             "/qscriptvalue/" "/Qscriptvalue/" "qscriptvalue\\\\." "Qscriptvalue\\\\."
107             "/qt/" "/Qt/" "qt\\\\." "Qt\\\\."
108             "/qt4/" "/Qt4/" "qt4\\\\." "Qt4\\\\."
109             "/win/" "/Win/" "win\\\\." "Win\\\\."
110             "/wxcode/" "/Wxcode/" "wxcode\\\\." "Wxcode\\\\."
111             "/WebKitLibraries/"
112             "/English\\\\.lproj/"
113             "/Source/WebKit2/"
114             "\\\\.a$"
115             "\\\\.exe$"
116             "\\\\.mm$"
117             )
118
119         # Append all Unknown port patterns
120         foreach (_pattern ${FILE_PATTERNS_UNKNOWN_PORTS})
121             list(FIND FILE_PATTERNS_${PORT} ${_pattern} _pattern_index)
122             if (_pattern_index GREATER -1)
123                 message("pattern ${_pattern} declared of 'no-port' is actually used by ${PORT}")
124             else ()
125                 list(APPEND CPACK_SOURCE_IGNORE_FILES ${_pattern})
126             endif ()
127         endforeach ()
128
129         # Append all "other-ports" patterns
130         foreach (_port ${ALL_PORTS})
131             if (NOT ${_port} STREQUAL ${PORT})
132                 foreach (_pattern ${FILE_PATTERNS_${_port}})
133
134                     list(FIND FILE_PATTERNS_${PORT} ${_pattern} _pattern_index)
135                     if (_pattern_index GREATER -1)
136                         message("pattern ${_pattern} of port ${_port} is also used by ${PORT}")
137                     else ()
138                         list(APPEND CPACK_SOURCE_IGNORE_FILES ${_pattern})
139                     endif ()
140                 endforeach ()
141             endif ()
142         endforeach ()
143
144     endif (NOT WEBKIT_CPACK_ALL_PORTS)
145
146 endif (NOT DEFINED CPACK_SOURCE_IGNORE_FILES)
147
148 # -----------------------------------------------------------------------------
149 # Include CPack that will define targets based on the variables defined before
150 # -----------------------------------------------------------------------------
151 include(CPack)