[WPE][CMake] Add "dist" and "distcheck" targets
[WebKit-https.git] / Source / PlatformWPE.cmake
1 if (DEVELOPER_MODE)
2     find_package(Xz REQUIRED)
3
4     configure_file(
5         ${TOOLS_DIR}/wpe/manifest.txt.in
6         ${CMAKE_BINARY_DIR}/manifest.txt
7     )
8
9     add_custom_target(distcheck
10         COMMENT "Checking release tarball: wpewebkit-${PROJECT_VERSION}.tar"
11         DEPENDS "${CMAKE_BINARY_DIR}/manifest.txt"
12                 "${TOOLS_DIR}/gtk/make-dist.py"
13         COMMAND "${TOOLS_DIR}/gtk/make-dist.py"
14                 "--check" "--port=WPE"
15                 "--tarball-name=wpewebkit"
16                 "--source-dir=${CMAKE_SOURCE_DIR}"
17                 "--build-dir=${CMAKE_BINARY_DIR}"
18                 "--version=${PROJECT_VERSION}"
19                 "${CMAKE_BINARY_DIR}/manifest.txt"
20         COMMAND "${XZ_EXECUTABLE}" "-evfQ"
21                 "${CMAKE_BINARY_DIR}/wpewebkit-${PROJECT_VERSION}.tar"
22         USES_TERMINAL
23     )
24
25     add_custom_command(
26         COMMENT "Creating release tarball: wpewebkit-${PROJECT_VERSION}.tar.xz"
27         OUTPUT "${CMAKE_BINARY_DIR}/wpewebkit-${PROJECT_VERSION}.tar.xz"
28         MAIN_DEPENDENCY "${CMAKE_BINARY_DIR}/manifest.txt"
29         DEPENDS "${TOOLS_DIR}/gtk/make-dist.py"
30         COMMAND "${TOOLS_DIR}/gtk/make-dist.py"
31                 "--tarball-name=wpewebkit"
32                 "--source-dir=${CMAKE_SOURCE_DIR}"
33                 "--build-dir=${CMAKE_BINARY_DIR}"
34                 "--version=${PROJECT_VERSION}"
35                 "${CMAKE_BINARY_DIR}/manifest.txt"
36         COMMAND "${XZ_EXECUTABLE}" "-evfQ"
37                 "${CMAKE_BINARY_DIR}/wpewebkit-${PROJECT_VERSION}.tar"
38         USES_TERMINAL
39     )
40
41     add_custom_target(dist
42         DEPENDS "${CMAKE_BINARY_DIR}/wpewebkit-${PROJECT_VERSION}.tar.xz"
43     )
44 endif ()