[CMake] Use WEBKIT_EXECUTABLE in ImageDiff
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Jun 2019 20:12:18 +0000 (20:12 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Jun 2019 20:12:18 +0000 (20:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=198490

Reviewed by Konstantin Tokarev.

Use WEBKIT_EXECUTABLE in ImageDiff. Change CMake variables to use the proper
convention. Add a shared CoreGraphics.cmake instead of just including PlatformMac
for AppleWin builds.

* ImageDiff/CMakeLists.txt:
* ImageDiff/Cairo.cmake:
* ImageDiff/CoreGraphics.cmake: Added.
* ImageDiff/PlatformGTK.cmake:
* ImageDiff/PlatformMac.cmake:
* ImageDiff/PlatformWin.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246044 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/ImageDiff/CMakeLists.txt
Tools/ImageDiff/Cairo.cmake
Tools/ImageDiff/CoreGraphics.cmake [new file with mode: 0644]
Tools/ImageDiff/PlatformGTK.cmake
Tools/ImageDiff/PlatformMac.cmake
Tools/ImageDiff/PlatformWin.cmake

index ad30a5b..59b5fae 100644 (file)
@@ -1,3 +1,21 @@
+2019-06-03  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Use WEBKIT_EXECUTABLE in ImageDiff
+        https://bugs.webkit.org/show_bug.cgi?id=198490
+
+        Reviewed by Konstantin Tokarev.
+
+        Use WEBKIT_EXECUTABLE in ImageDiff. Change CMake variables to use the proper
+        convention. Add a shared CoreGraphics.cmake instead of just including PlatformMac
+        for AppleWin builds.
+
+        * ImageDiff/CMakeLists.txt:
+        * ImageDiff/Cairo.cmake:
+        * ImageDiff/CoreGraphics.cmake: Added.
+        * ImageDiff/PlatformGTK.cmake:
+        * ImageDiff/PlatformMac.cmake:
+        * ImageDiff/PlatformWin.cmake:
+
 2019-06-02  Andy Estes  <aestes@apple.com>
 
         Memory-cached main resources continue to load after the client decides a content policy of PolicyAction::Download
index 9c58cc5..93831cd 100644 (file)
@@ -1,23 +1,14 @@
 set(IMAGE_DIFF_DIR "${TOOLS_DIR}/ImageDiff")
 
-set(IMAGE_DIFF_SYSTEM_INCLUDE_DIRECTORIES "")
-
-set(IMAGE_DIFF_SOURCES
-    ${IMAGE_DIFF_DIR}/ImageDiff.cpp
-    ${IMAGE_DIFF_DIR}/PlatformImage.cpp
+set(ImageDiff_SOURCES
+    ImageDiff.cpp
+    PlatformImage.cpp
 )
 
-set(IMAGE_DIFF_INCLUDE_DIRECTORIES
+set(ImageDiff_PRIVATE_INCLUDE_DIRECTORIES
     ${IMAGE_DIFF_DIR}
 )
 
+WEBKIT_EXECUTABLE_DECLARE(ImageDiff)
 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
-
-include_directories(${IMAGE_DIFF_INCLUDE_DIRECTORIES})
-include_directories(SYSTEM ${IMAGE_DIFF_SYSTEM_INCLUDE_DIRECTORIES})
-add_executable(ImageDiff ${IMAGE_DIFF_SOURCES})
-target_link_libraries(ImageDiff ${IMAGE_DIFF_LIBRARIES})
-
-if (WIN32)
-    add_dependencies(ImageDiff ImageDiffLib)
-endif ()
+WEBKIT_EXECUTABLE(ImageDiff)
index fde8c09..66c34d6 100644 (file)
@@ -1,13 +1,13 @@
-list(APPEND IMAGE_DIFF_SOURCES
-    ${IMAGE_DIFF_DIR}/cairo/PlatformImageCairo.cpp
+list(APPEND ImageDiff_SOURCES
+    cairo/PlatformImageCairo.cpp
 )
 
-list(APPEND IMAGE_DIFF_SYSTEM_INCLUDE_DIRECTORIES
+list(APPEND ImageDiff_SYSTEM_INCLUDE_DIRECTORIES
     ${CAIRO_INCLUDE_DIRS}
 )
 
-list(APPEND IMAGE_DIFF_LIBRARIES
+list(APPEND ImageDiff_LIBRARIES
     ${CAIRO_LIBRARIES}
 )
 
-add_definitions(-DUSE_CAIRO=1)
+list(APPEND ImageDiff_PRIVATE_DEFINITIONS USE_CAIRO=1)
diff --git a/Tools/ImageDiff/CoreGraphics.cmake b/Tools/ImageDiff/CoreGraphics.cmake
new file mode 100644 (file)
index 0000000..a8d5e07
--- /dev/null
@@ -0,0 +1,9 @@
+list(APPEND ImageDiff_SOURCES
+    cg/PlatformImageCG.cpp
+)
+
+list(APPEND ImageDiff_LIBRARIES
+    CoreFoundation
+    CoreGraphics
+    CoreText
+)
index bd6c000..aa3d657 100644 (file)
@@ -1,8 +1 @@
-list(APPEND IMAGE_DIFF_SOURCES
-    ${IMAGE_DIFF_DIR}/cg/PlatformImageCG.cpp
-)
-list(APPEND IMAGE_DIFF_LIBRARIES
-    CoreFoundation
-    CoreGraphics
-    CoreText
-)
+include(CoreGraphics.cmake)
index 08d49f7..d7b7d34 100644 (file)
@@ -1,15 +1,15 @@
+set(wrapper_DEFINITIONS USE_CONSOLE_ENTRY_POINT)
+
 if (${WTF_PLATFORM_WIN_CAIRO})
-    add_definitions(-DWIN_CAIRO)
+    list(APPEND wrapper_DEFINITIONS WIN_CAIRO)
 
     include(Cairo.cmake)
 else ()
-    include(PlatformMac.cmake)
+    include(CoreGraphics.cmake)
 endif ()
 
-add_library(ImageDiffLib SHARED ${IMAGE_DIFF_SOURCES})
-target_link_libraries(ImageDiffLib ${IMAGE_DIFF_LIBRARIES})
-
-add_definitions(-DUSE_CONSOLE_ENTRY_POINT)
-
-set(IMAGE_DIFF_SOURCES ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp)
-set(IMAGE_DIFF_LIBRARIES shlwapi)
+WEBKIT_WRAP_EXECUTABLE(ImageDiff
+    SOURCES ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
+    LIBRARIES shlwapi
+)
+target_compile_definitions(ImageDiff PRIVATE ${wrapper_DEFINITIONS})