create_lut(WebCore-unity_LIB_SRCS bindings/js/kjs_traversal.cpp kjs_traversal.lut.h bindings/js/kjs_traversal.cpp)
create_lut(WebCore-unity_LIB_SRCS bindings/js/JSXMLHttpRequest.cpp JSXMLHttpRequest.lut.h bindings/js/JSXMLHttpRequest.cpp)
create_lut(WebCore-unity_LIB_SRCS bindings/js/JSXSLTProcessor.cpp JSXSLTProcessor.lut.h bindings/js/JSXSLTProcessor.cpp)
-create_cpp_lut(bindings/js/JSHTMLInputElementBase.cpp JSHTMLInputElementBaseTable.cpp bindings/js/JSHTMLInputElementBase.cpp)
+
+# now this is ugly
+# WebKit sources include some generated files which have the suffix ".cpp"
+# the CMake way to create the dependencies of targets to generated files is
+# to list the generated files as part of the sources for the target.
+# If this would be done for the generated-and-then-included cpp-files
+# they would be compiled twice (once included and once on their own).
+# The easy way would be to rename the generated files to use the suffix
+# ".inl" or something like this. But this is not wanted by the WebKit developers
+# AFAIK. So we have to work around it here. This is done by renaming the
+# generated files to *.inl and adding these files to the list of sources
+# (WebCore-unity_LIB_SRCS). But the include-statements still want a cpp-file,
+# so tell CMake to create these cpp-files at cmake-time, but these files contain
+# nothing except an include-statement for the inl-file. Alex
+macro(CREATE_GENERATED_CPP_HELPER _inlName)
+ get_filename_component(_baseName ${_inlName} NAME_WE)
+ if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${_baseName}.cpp)
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_baseName}.cpp
+"/* This file is autogenerated by CMake. *
+ * Do not edit, changes will be lost. *
+ * With the CMake buildsystem giving generated-but-not-compiled-on-their-own *
+ * files the suffix \".cpp\" is not recommended, because it breaks the *
+ * dependency handling. So the actual generated file has the suffix \".inl\" *
+ * and this file here only exists as a helper. */
+#include \"${CMAKE_CURRENT_BINARY_DIR}/${_inlName}\"\n")
+ endif (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${_baseName}.cpp)
+ set(WebCore-unity_LIB_SRCS ${WebCore-unity_LIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/${_inlName})
+endmacro(CREATE_GENERATED_CPP_HELPER _inlName)
+
+
+create_cpp_lut(bindings/js/JSHTMLInputElementBase.cpp JSHTMLInputElementBaseTable.inl bindings/js/JSHTMLInputElementBase.cpp)
+create_generated_cpp_helper(JSHTMLInputElementBaseTable.inl)
+
IF (WEBKIT_USE_SVG_SUPPORT)
- create_cpp_lut(ksvg2/bindings/js/JSSVGNumber.cpp JSSVGNumberTable.cpp ksvg2/bindings/js/JSSVGNumber.cpp)
- create_cpp_lut(ksvg2/bindings/js/JSSVGPoint.cpp JSSVGPointTable.cpp ksvg2/bindings/js/JSSVGPoint.cpp)
- create_cpp_lut(ksvg2/bindings/js/JSSVGRect.cpp JSSVGRectTable.cpp ksvg2/bindings/js/JSSVGRect.cpp)
-ENDIF (WEBKIT_USE_SVG_SUPPORT)
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tokenizer.cpp
- COMMAND flex -t < ${CMAKE_CURRENT_SOURCE_DIR}/css/tokenizer.flex | perl ${CMAKE_CURRENT_SOURCE_DIR}/css/maketokenizer > ${CMAKE_CURRENT_BINARY_DIR}/tokenizer.cpp
+ create_cpp_lut(ksvg2/bindings/js/JSSVGNumber.cpp JSSVGNumberTable.inl ksvg2/bindings/js/JSSVGNumber.cpp)
+ create_cpp_lut(ksvg2/bindings/js/JSSVGPoint.cpp JSSVGPointTable.inl ksvg2/bindings/js/JSSVGPoint.cpp)
+ create_generated_cpp_helper(JSSVGPointTable.inl)
+ create_cpp_lut(ksvg2/bindings/js/JSSVGRect.cpp JSSVGRectTable.inl ksvg2/bindings/js/JSSVGRect.cpp)
+ create_generated_cpp_helper(JSSVGRectTable.inl)
+
+ENDIF (WEBKIT_USE_SVG_SUPPORT)
+add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tokenizer.inl
+ COMMAND flex -t < ${CMAKE_CURRENT_SOURCE_DIR}/css/tokenizer.flex | perl ${CMAKE_CURRENT_SOURCE_DIR}/css/maketokenizer > ${CMAKE_CURRENT_BINARY_DIR}/tokenizer.inl
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/css/tokenizer.flex
)
+create_generated_cpp_helper(tokenizer.inl)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/CSSPropertyNames.h ${CMAKE_CURRENT_BINARY_DIR}/CSSPropertyNames.c