6fe884ddfed3e8a8d8812dc895d83f1a9991f4e0
[WebKit.git] / Source / WebInspectorUI / CMakeLists.txt
1
2 set(InspectorFiles
3     ${WEBINSPECTORUI_DIR}/UserInterface/*.html
4     ${WEBINSPECTORUI_DIR}/UserInterface/Base/*.js
5     ${WEBINSPECTORUI_DIR}/UserInterface/Controllers/*.css
6     ${WEBINSPECTORUI_DIR}/UserInterface/Controllers/*.js
7     ${WEBINSPECTORUI_DIR}/UserInterface/Debug/*.css
8     ${WEBINSPECTORUI_DIR}/UserInterface/Debug/*.js
9     ${WEBINSPECTORUI_DIR}/UserInterface/External/CodeMirror/*.css
10     ${WEBINSPECTORUI_DIR}/UserInterface/External/CodeMirror/*.js
11     ${WEBINSPECTORUI_DIR}/UserInterface/External/Esprima/*.js
12     ${WEBINSPECTORUI_DIR}/UserInterface/External/three.js/*.js
13     ${WEBINSPECTORUI_DIR}/UserInterface/Models/*.js
14     ${WEBINSPECTORUI_DIR}/UserInterface/Protocol/*.js
15     ${WEBINSPECTORUI_DIR}/UserInterface/Proxies/*.js
16     ${WEBINSPECTORUI_DIR}/UserInterface/Test/*.js
17     ${WEBINSPECTORUI_DIR}/UserInterface/Views/*.css
18     ${WEBINSPECTORUI_DIR}/UserInterface/Views/*.js
19     ${WEBINSPECTORUI_DIR}/UserInterface/Workers/Formatter/*.js
20     ${WEBINSPECTORUI_DIR}/UserInterface/Workers/HeapSnapshot/*.js
21     ${WEBINSPECTORUI_DIR}/UserInterface/Images/*.png
22     ${WEBINSPECTORUI_DIR}/UserInterface/Images/*.svg
23     ${WEBINSPECTORUI_DIR}/Localizations/en.lproj/localizedStrings.js
24 )
25
26 file(GLOB InspectorFilesDependencies
27     ${InspectorFiles}
28 )
29
30 set(InspectorResourceScripts
31     ${WEBINSPECTORUI_DIR}/Scripts/combine-resources.pl
32     ${WEBINSPECTORUI_DIR}/Scripts/copy-user-interface-resources.pl
33     ${WEBINSPECTORUI_DIR}/Scripts/fix-worker-imports-for-optimized-builds.pl
34     ${WEBINSPECTORUI_DIR}/Scripts/remove-console-asserts.pl
35     ${JavaScriptCore_SCRIPTS_DIR}/cssmin.py
36     ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py
37 )
38
39 set(WebInspectorUI_RESOURCES_DIR "${WebInspectorUI_DERIVED_SOURCES_DIR}")
40 set(WebInspectorUI_LOCALIZED_STRINGS_DIR "${WebInspectorUI_RESOURCES_DIR}/InspectorResources/WebInspectorUI/Localizations/en.lproj")
41
42 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
43
44 # DerivedSources/JavaScriptCore/inspector/InspectorBackendCommands.js is
45 # expected in DerivedSources/WebInspectorUI/UserInterface/Protocol/.
46 add_custom_command(
47     OUTPUT ${WebInspectorUI_DERIVED_SOURCES_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
48     DEPENDS ${JavaScriptCore_DERIVED_SOURCES_DIR}/inspector/InspectorBackendCommands.js
49     COMMAND ${CMAKE_COMMAND} -E copy ${JavaScriptCore_DERIVED_SOURCES_DIR}/inspector/InspectorBackendCommands.js ${WebInspectorUI_DERIVED_SOURCES_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
50     VERBATIM
51 )
52
53 if (NOT DEFINED COMBINE_INSPECTOR_RESOURCES)
54     if (CMAKE_BUILD_TYPE STREQUAL "Debug")
55         set(COMBINE_INSPECTOR_RESOURCES NO)
56     else ()
57         set(COMBINE_INSPECTOR_RESOURCES YES)
58     endif ()
59 endif ()
60 if (NOT DEFINED COMBINE_TEST_RESOURCES)
61     if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR DEVELOPER_MODE)
62         set(COMBINE_TEST_RESOURCES YES)
63     else ()
64         set(COMBINE_TEST_RESOURCES NO)
65     endif ()
66 endif ()
67
68 add_custom_target(
69     WebInspectorUI
70     DEPENDS ${InspectorFilesDependencies}
71             ${InspectorResourceScripts}
72             ${WebInspectorUI_DERIVED_SOURCES_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
73     COMMAND ${CMAKE_COMMAND} -E copy ${WebInspectorUI_DERIVED_SOURCES_DIR}/UserInterface/Protocol/InspectorBackendCommands.js ${JavaScriptCore_SCRIPTS_DIR}/InspectorBackendCommands.js
74     COMMAND ${CMAKE_COMMAND} -E env "DERIVED_SOURCES_DIR=${WebInspectorUI_DERIVED_SOURCES_DIR}" "SRCROOT=${WEBINSPECTORUI_DIR}" "JAVASCRIPTCORE_PRIVATE_HEADERS_DIR=${JavaScriptCore_SCRIPTS_DIR}" "TARGET_BUILD_DIR=${WebInspectorUI_RESOURCES_DIR}" "UNLOCALIZED_RESOURCES_FOLDER_PATH=WebInspectorUI" "COMBINE_INSPECTOR_RESOURCES=${COMBINE_INSPECTOR_RESOURCES}" "COMBINE_TEST_RESOURCES=${COMBINE_TEST_RESOURCES}" PYTHON=${PYTHON_EXECUTABLE} ${PERL_EXECUTABLE} ${WEBINSPECTORUI_DIR}/Scripts/copy-user-interface-resources.pl
75     COMMAND ${CMAKE_COMMAND} -E make_directory ${WebInspectorUI_LOCALIZED_STRINGS_DIR}
76     COMMAND ${CMAKE_COMMAND} -E copy "${WEBINSPECTORUI_DIR}/Localizations/en.lproj/localizedStrings.js" ${WebInspectorUI_LOCALIZED_STRINGS_DIR}/localizedStrings.js
77     COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/inspector-resources.stamp
78     VERBATIM
79 )