[CMake] Add WEBKIT_EXECUTABLE macro
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 27 Apr 2019 00:06:38 +0000 (00:06 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 27 Apr 2019 00:06:38 +0000 (00:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197206

Reviewed by Konstantin Tokarev.

.:

Add WEBKIT_EXECUTABLE macro for creating executable targets. This wraps the creation of
executable targets using the same conventions of WEBKIT_FRAMEWORK.

Common code from the two macros were moved to WEBKIT_TARGET which is meant as an internal
macro.

Add WEBKIT_WRAP_EXECUTABLE macro to support Windows targets which use a DLLLauncherMain to
launch the executable.

* Source/cmake/WebKitMacros.cmake:

Source/JavaScriptCore:

Migrate to WEBKIT_EXECUTABLE for the jsc and test targets.

* b3/air/testair.cpp:
* b3/testb3.cpp:
* dfg/testdfg.cpp:
* shell/CMakeLists.txt:
* shell/PlatformGTK.cmake:
* shell/PlatformJSCOnly.cmake: Removed.
* shell/PlatformMac.cmake:
* shell/PlatformPlayStation.cmake:
* shell/PlatformWPE.cmake:
* shell/PlatformWin.cmake:

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

13 files changed:
ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/b3/air/testair.cpp
Source/JavaScriptCore/b3/testb3.cpp
Source/JavaScriptCore/dfg/testdfg.cpp
Source/JavaScriptCore/shell/CMakeLists.txt
Source/JavaScriptCore/shell/PlatformGTK.cmake
Source/JavaScriptCore/shell/PlatformJSCOnly.cmake [deleted file]
Source/JavaScriptCore/shell/PlatformMac.cmake
Source/JavaScriptCore/shell/PlatformPlayStation.cmake
Source/JavaScriptCore/shell/PlatformWPE.cmake
Source/JavaScriptCore/shell/PlatformWin.cmake
Source/cmake/WebKitMacros.cmake

index 1f0e867..6e2ef34 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2019-04-26  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Add WEBKIT_EXECUTABLE macro
+        https://bugs.webkit.org/show_bug.cgi?id=197206
+
+        Reviewed by Konstantin Tokarev.
+
+        Add WEBKIT_EXECUTABLE macro for creating executable targets. This wraps the creation of
+        executable targets using the same conventions of WEBKIT_FRAMEWORK.
+
+        Common code from the two macros were moved to WEBKIT_TARGET which is meant as an internal
+        macro.
+
+        Add WEBKIT_WRAP_EXECUTABLE macro to support Windows targets which use a DLLLauncherMain to
+        launch the executable.
+
+        * Source/cmake/WebKitMacros.cmake:
+
 2019-04-25  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         Unreviewed, rolling out r244669.
index 5f2e648..8a06f60 100644 (file)
@@ -1,3 +1,23 @@
+2019-04-26  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Add WEBKIT_EXECUTABLE macro
+        https://bugs.webkit.org/show_bug.cgi?id=197206
+
+        Reviewed by Konstantin Tokarev.
+
+        Migrate to WEBKIT_EXECUTABLE for the jsc and test targets.
+
+        * b3/air/testair.cpp:
+        * b3/testb3.cpp:
+        * dfg/testdfg.cpp:
+        * shell/CMakeLists.txt:
+        * shell/PlatformGTK.cmake:
+        * shell/PlatformJSCOnly.cmake: Removed.
+        * shell/PlatformMac.cmake:
+        * shell/PlatformPlayStation.cmake:
+        * shell/PlatformWPE.cmake:
+        * shell/PlatformWin.cmake:
+
 2019-04-25  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [JSC] linkPolymorphicCall now does GC
index 9dc9966..ef1544c 100644 (file)
@@ -2216,3 +2216,10 @@ int main(int argc, char** argv)
 
     return 0;
 }
+
+#if OS(WINDOWS)
+extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(int argc, const char* argv[])
+{
+    return main(argc, const_cast<char**>(argv));
+}
+#endif
index ff3b3b5..7f31679 100644 (file)
@@ -18800,3 +18800,9 @@ int main(int argc, char** argv)
     return 0;
 }
 
+#if OS(WINDOWS)
+extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(int argc, const char* argv[])
+{
+    return main(argc, const_cast<char**>(argv));
+}
+#endif
index 5335e64..6d33229 100644 (file)
@@ -118,3 +118,10 @@ int main(int argc, char** argv)
 
     return 0;
 }
+
+#if OS(WINDOWS)
+extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(int argc, const char* argv[])
+{
+    return main(argc, const_cast<char**>(argv));
+}
+#endif
index aa7ce64..434f9c6 100644 (file)
-set(JSC_SOURCES
+set(jsc_SOURCES
     ../jsc.cpp
 )
 
-set(JSC_LIBRARIES
+if ("${JavaScriptCore_LIBRARY_TYPE}" MATCHES "STATIC")
+    set(jsc_PRIVATE_DEFINITIONS STATICALLY_LINKED_WITH_JavaScriptCore)
+endif ()
+
+set(jsc_LIBRARIES
     ${CMAKE_DL_LIBS}
     JavaScriptCore${DEBUG_SUFFIX}
     WTF${DEBUG_SUFFIX}
 )
 
+set(jsc_PRIVATE_INCLUDE_DIRECTORIES
+    ${JavaScriptCore_INCLUDE_DIRECTORIES}
+    ${JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES}
+    ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS_DIR}
+    ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES}
+)
+
 if (WTF_OS_MAC_OS_X)
-    list(APPEND JSC_LIBRARIES edit)
+    list(APPEND jsc_LIBRARIES edit)
 endif ()
 
-if ("${JavaScriptCore_LIBRARY_TYPE}" MATCHES "STATIC")
-    add_definitions(-DSTATICALLY_LINKED_WITH_JavaScriptCore)
+WEBKIT_EXECUTABLE_DECLARE(jsc)
+
+if (DEVELOPER_MODE)
+    set(testapi_SOURCES
+        ../API/tests/CompareAndSwapTest.cpp
+        ../API/tests/CustomGlobalObjectClassTest.c
+        ../API/tests/ExecutionTimeLimitTest.cpp
+        ../API/tests/FunctionOverridesTest.cpp
+        ../API/tests/GlobalContextWithFinalizerTest.cpp
+        ../API/tests/JSONParseTest.cpp
+        ../API/tests/JSObjectGetProxyTargetTest.cpp
+        ../API/tests/MultithreadedMultiVMExecutionTest.cpp
+        ../API/tests/PingPongStackOverflowTest.cpp
+        ../API/tests/TypedArrayCTest.cpp
+        ../API/tests/testapi.c
+        ../API/tests/testapi.cpp
+    )
+    set(testapi_DEFINITIONS ${jsc_PRIVATE_DEFINITIONS})
+    set(testapi_PRIVATE_INCLUDE_DIRECTORIES ${jsc_PRIVATE_INCLUDE_DIRECTORIES})
+    set(testapi_LIBRARIES JavaScriptCore)
+
+    set(testmasm_SOURCES ../assembler/testmasm.cpp)
+    set(testmasm_DEFINITIONS ${jsc_PRIVATE_DEFINITIONS})
+    set(testmasm_PRIVATE_INCLUDE_DIRECTORIES ${jsc_PRIVATE_INCLUDE_DIRECTORIES})
+    set(testmasm_LIBRARIES JavaScriptCore)
+
+    set(testRegExp_SOURCES ../testRegExp.cpp)
+    set(testRegExp_DEFINITIONS ${jsc_PRIVATE_DEFINITIONS})
+    set(testRegExp_PRIVATE_INCLUDE_DIRECTORIES ${jsc_PRIVATE_INCLUDE_DIRECTORIES})
+    set(testRegExp_LIBRARIES JavaScriptCore)
+
+    set(testb3_SOURCES ../b3/testb3.cpp)
+    set(testb3_DEFINITIONS ${jsc_PRIVATE_DEFINITIONS})
+    set(testb3_PRIVATE_INCLUDE_DIRECTORIES ${jsc_PRIVATE_INCLUDE_DIRECTORIES})
+    set(testb3_LIBRARIES JavaScriptCore)
+
+    set(testair_SOURCES ../b3/air/testair.cpp)
+    set(testair_DEFINITIONS ${jsc_PRIVATE_DEFINITIONS})
+    set(testair_PRIVATE_INCLUDE_DIRECTORIES ${jsc_PRIVATE_INCLUDE_DIRECTORIES})
+    set(testair_LIBRARIES JavaScriptCore)
+
+    set(testdfg_SOURCES ../dfg/testdfg.cpp)
+    set(testdfg_DEFINITIONS ${jsc_PRIVATE_DEFINITIONS})
+    set(testdfg_PRIVATE_INCLUDE_DIRECTORIES ${jsc_PRIVATE_INCLUDE_DIRECTORIES})
+    set(testdfg_LIBRARIES JavaScriptCore)
+
+    WEBKIT_EXECUTABLE_DECLARE(testapi)
+    WEBKIT_EXECUTABLE_DECLARE(testRegExp)
+    WEBKIT_EXECUTABLE_DECLARE(testmasm)
+    WEBKIT_EXECUTABLE_DECLARE(testb3)
+    WEBKIT_EXECUTABLE_DECLARE(testair)
+    WEBKIT_EXECUTABLE_DECLARE(testdfg)
 endif ()
 
-set(TESTAPI_SOURCES
-    ../API/tests/CompareAndSwapTest.cpp
-    ../API/tests/CustomGlobalObjectClassTest.c
-    ../API/tests/ExecutionTimeLimitTest.cpp
-    ../API/tests/FunctionOverridesTest.cpp
-    ../API/tests/GlobalContextWithFinalizerTest.cpp
-    ../API/tests/JSONParseTest.cpp
-    ../API/tests/JSObjectGetProxyTargetTest.cpp
-    ../API/tests/MultithreadedMultiVMExecutionTest.cpp
-    ../API/tests/PingPongStackOverflowTest.cpp
-    ../API/tests/TypedArrayCTest.cpp
-    ../API/tests/testapi.c
-    ../API/tests/testapi.cpp
-)
-
 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 
-WEBKIT_WRAP_SOURCELIST(${JSC_SOURCES})
-WEBKIT_WRAP_SOURCELIST(${TESTAPI_SOURCES})
-include_directories(./ ${JavaScriptCore_INCLUDE_DIRECTORIES} ${JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES})
-include_directories(SYSTEM ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
-add_executable(jsc ${JSC_SOURCES})
-target_link_libraries(jsc ${JSC_LIBRARIES})
-
-if (JSC_OUTPUT_NAME)
-    set_target_properties(jsc PROPERTIES OUTPUT_NAME ${JSC_OUTPUT_NAME})
-endif ()
-
-if (JSC_LINK_FLAGS)
-    WEBKIT_ADD_TARGET_PROPERTIES(jsc LINK_FLAGS "${JSC_LINK_FLAGS}")
-endif ()
+WEBKIT_EXECUTABLE(jsc)
 
 if (SHOULD_INSTALL_JS_SHELL)
     install(TARGETS jsc DESTINATION "${LIBEXEC_INSTALL_DIR}")
 endif ()
 
-if (TARGET jscLib)
-    add_dependencies(jsc jscLib)
+if (DEVELOPER_MODE)
+    WEBKIT_EXECUTABLE(testapi)
+    WEBKIT_EXECUTABLE(testRegExp)
+    WEBKIT_EXECUTABLE(testmasm)
+    WEBKIT_EXECUTABLE(testb3)
+    WEBKIT_EXECUTABLE(testair)
+    WEBKIT_EXECUTABLE(testdfg)
+
+    file(COPY
+        "${JAVASCRIPTCORE_DIR}/API/tests/testapi.js"
+        DESTINATION
+        ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/testapiScripts
+    )
+    file(COPY
+        "${JAVASCRIPTCORE_DIR}/API/tests/testapi-function-overrides.js"
+        DESTINATION
+        ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/testapiScripts
+    )
 endif ()
-
-set(TESTMASM_SOURCES
-    ../assembler/testmasm.cpp
-)
-
-set(TESTB3_SOURCES
-    ../b3/testb3.cpp
-)
-
-set(TESTAIR_SOURCES
-    ../b3/air/testair.cpp
-)
-
-set(TESTDFG_SOURCES
-    ../dfg/testdfg.cpp
-)
-
-if (DEVELOPER_MODE AND NOT WIN32)
-    add_executable(testmasm ${TESTMASM_SOURCES})
-    target_link_libraries(testmasm ${JSC_LIBRARIES})
-
-    add_executable(testb3 ${TESTB3_SOURCES})
-    target_link_libraries(testb3 ${JSC_LIBRARIES})
-
-    add_executable(testair ${TESTAIR_SOURCES})
-    target_link_libraries(testair ${JSC_LIBRARIES})
-
-    add_executable(testdfg ${TESTDFG_SOURCES})
-    target_link_libraries(testdfg ${JSC_LIBRARIES})
-
-    add_executable(testapi ${TESTAPI_SOURCES})
-    target_link_libraries(testapi ${JSC_LIBRARIES})
-endif ()
-
-file(COPY
-    "${JAVASCRIPTCORE_DIR}/API/tests/testapi.js"
-    DESTINATION
-    ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/testapiScripts
-)
-file(COPY
-    "${JAVASCRIPTCORE_DIR}/API/tests/testapi-function-overrides.js"
-    DESTINATION
-    ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/testapiScripts
-)
index 623183a..c4ac7c9 100644 (file)
@@ -1,3 +1,3 @@
-list(APPEND JSC_LIBRARIES
+list(APPEND jsc_LIBRARIES
     ${GLIB_LIBRARIES}
 )
diff --git a/Source/JavaScriptCore/shell/PlatformJSCOnly.cmake b/Source/JavaScriptCore/shell/PlatformJSCOnly.cmake
deleted file mode 100644 (file)
index ca4f127..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# FIXME: https://bugs.webkit.org/show_bug.cgi?id=178730
-# Make the Windows build and other builds work more similarly
-# rather than having a very different build process with
-# library/launcher on Windows and build directly into
-# executable elsewhere
-if (WIN32)
-    include(PlatformWin.cmake)
-    add_definitions(-DWIN_CAIRO)
-endif ()
index 7c0fea2..830680b 100644 (file)
@@ -1,4 +1,4 @@
-set(TESTAPI_OBJC_SOURCES
+set(testapi_OBJC_SOURCES
     ../API/tests/CurrentThisInsideBlockGetterTest.mm
     ../API/tests/DateTests.mm
     ../API/tests/JSExportTests.mm
@@ -6,6 +6,5 @@ set(TESTAPI_OBJC_SOURCES
     ../API/tests/Regress141809.mm
     ../API/tests/testapi.mm
 )
-list(APPEND TESTAPI_SOURCES ${TESTAPI_OBJC_SOURCES})
-
-set_source_files_properties(${TESTAPI_OBJC_SOURCES} PROPERTIES COMPILE_FLAGS -fobjc-arc)
+list(APPEND testapi_SOURCES ${testapi_OBJC_SOURCES})
+set_source_files_properties(${testapi_OBJC_SOURCES} PROPERTIES COMPILE_FLAGS -fobjc-arc)
index 0937f93..56b43d8 100644 (file)
@@ -1,5 +1,4 @@
-
-list(APPEND JSC_SOURCES
+list(APPEND jsc_SOURCES
     ${JAVASCRIPTCORE_DIR}/shell/playstation/Initializer.cpp
 )
 
@@ -8,4 +7,4 @@ find_library(LIBTESTWRAPPERS testwrappers PATHS ${WEBKIT_LIBRARIES_DIR}/lib)
 set(PLAYSTATION_jsc_PROCESS_NAME "JSCShell")
 set(PLAYSTATION_jsc_MAIN_THREAD_NAME "JSCShell")
 set(PLAYSTATION_jsc_WRAP fopen getcwd main)
-list(APPEND JSC_LIBRARIES ${LIBTESTWRAPPERS})
+list(APPEND jsc_LIBRARIES ${LIBTESTWRAPPERS})
index 15754f4..1bec33b 100644 (file)
@@ -1,4 +1,4 @@
-list(APPEND JSC_LIBRARIES
+list(APPEND jsc_LIBRARIES
     ${GLIB_LIBRARIES}
     ${GLIB_GMODULE_LIBRARIES}
 )
index aafc629..c124084 100644 (file)
@@ -1,40 +1,56 @@
-include_directories(./ PRIVATE ${JavaScriptCore_INCLUDE_DIRECTORIES} ${JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES} ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS_DIR})
-include_directories(SYSTEM ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
-add_library(jscLib SHARED ${JSC_SOURCES})
-
-list(APPEND JSC_LIBRARIES
-    Winmm
-)
-
-target_link_libraries(jscLib ${JSC_LIBRARIES})
+set(wrapper_DEFINITIONS USE_CONSOLE_ENTRY_POINT)
 
 if (${WTF_PLATFORM_WIN_CAIRO})
-    add_definitions(-DWIN_CAIRO)
+    list(APPEND wrapper_DEFINITIONS WIN_CAIRO)
 endif ()
 
-set(JSC_SOURCES ${JAVASCRIPTCORE_DIR}/shell/DLLLauncherMain.cpp)
-set(JSC_LIBRARIES shlwapi)
-add_definitions(-DUSE_CONSOLE_ENTRY_POINT)
-
-set(JSC_OUTPUT_NAME "jsc${DEBUG_SUFFIX}")
-
-add_library(testRegExpLib SHARED ../testRegExp.cpp)
-add_executable(testRegExp ${JSC_SOURCES})
-set_target_properties(testRegExp PROPERTIES OUTPUT_NAME "testRegExp${DEBUG_SUFFIX}")
-target_link_libraries(testRegExp shlwapi)
-add_dependencies(testRegExp testRegExpLib)
-target_link_libraries(testRegExpLib JavaScriptCore)
-
-add_library(testapiLib SHARED ${TESTAPI_SOURCES})
-add_executable(testapi ${JSC_SOURCES})
-set_target_properties(testapi PROPERTIES OUTPUT_NAME "testapi${DEBUG_SUFFIX}")
-target_link_libraries(testapi shlwapi)
-add_dependencies(testapi testapiLib)
-target_link_libraries(testapiLib JavaScriptCore)
-
-add_library(testmasmLib SHARED ../assembler/testmasm.cpp)
-add_executable(testmasm ${JSC_SOURCES})
-set_target_properties(testmasm PROPERTIES OUTPUT_NAME "testmasm${DEBUG_SUFFIX}")
-target_link_libraries(testmasm shlwapi)
-add_dependencies(testmasm testmasmLib)
-target_link_libraries(testmasmLib JavaScriptCore)
+WEBKIT_WRAP_EXECUTABLE(jsc
+    SOURCES DLLLauncherMain.cpp
+    LIBRARIES shlwapi
+)
+target_compile_definitions(jsc PRIVATE ${wrapper_DEFINITIONS})
+set(jsc_OUTPUT_NAME jsc${DEBUG_SUFFIX})
+
+if (DEVELOPER_MODE)
+    WEBKIT_WRAP_EXECUTABLE(testapi
+        SOURCES DLLLauncherMain.cpp
+        LIBRARIES shlwapi
+    )
+    target_compile_definitions(testapi PRIVATE ${wrapper_DEFINITIONS})
+    set(testapi_OUTPUT_NAME testapi${DEBUG_SUFFIX})
+
+    WEBKIT_WRAP_EXECUTABLE(testRegExp
+        SOURCES DLLLauncherMain.cpp
+        LIBRARIES shlwapi
+    )
+    target_compile_definitions(testRegExp PRIVATE ${wrapper_DEFINITIONS})
+    set(testRegExp_OUTPUT_NAME testRegExp${DEBUG_SUFFIX})
+
+    WEBKIT_WRAP_EXECUTABLE(testmasm
+        SOURCES DLLLauncherMain.cpp
+        LIBRARIES shlwapi
+    )
+    target_compile_definitions(testmasm PRIVATE ${wrapper_DEFINITIONS})
+    set(testmasm_OUTPUT_NAME testmasm${DEBUG_SUFFIX})
+
+    WEBKIT_WRAP_EXECUTABLE(testb3
+        SOURCES DLLLauncherMain.cpp
+        LIBRARIES shlwapi
+    )
+    target_compile_definitions(testb3 PRIVATE ${wrapper_DEFINITIONS})
+    set(testb3_OUTPUT_NAME testb3${DEBUG_SUFFIX})
+
+    WEBKIT_WRAP_EXECUTABLE(testair
+        SOURCES DLLLauncherMain.cpp
+        LIBRARIES shlwapi
+    )
+    target_compile_definitions(testair PRIVATE ${wrapper_DEFINITIONS})
+    set(testair_OUTPUT_NAME testair${DEBUG_SUFFIX})
+
+    WEBKIT_WRAP_EXECUTABLE(testdfg
+        SOURCES DLLLauncherMain.cpp
+        LIBRARIES shlwapi
+    )
+    target_compile_definitions(testdfg PRIVATE ${wrapper_DEFINITIONS})
+    set(testdfg_OUTPUT_NAME testdfg${DEBUG_SUFFIX})
+endif ()
index a065b1c..48ee725 100644 (file)
@@ -142,16 +142,41 @@ macro(WEBKIT_FRAMEWORK_DECLARE _target)
     add_library(${_target} ${${_target}_LIBRARY_TYPE} "${CMAKE_BINARY_DIR}/cmakeconfig.h")
 endmacro()
 
-macro(WEBKIT_FRAMEWORK _target)
-    target_sources(${_target} PRIVATE
-        ${${_target}_HEADERS}
-        ${${_target}_SOURCES}
+macro(WEBKIT_EXECUTABLE_DECLARE _target)
+    add_executable(${_target} "${CMAKE_BINARY_DIR}/cmakeconfig.h")
+endmacro()
+
+# Private macro for setting the properties of a target.
+# Rather than just having _target like WEBKIT_FRAMEWORK and WEBKIT_EXECUTABLE the parameters are
+# split into _target_logical_name, which is used for variable expansion, and _target_cmake_name.
+# This is done to support WEBKIT_WRAP_EXECUTABLE which uses the _target_logical_name variables
+# but requires a different _target_cmake_name.
+macro(_WEBKIT_TARGET _target_logical_name _target_cmake_name)
+    target_sources(${_target_cmake_name} PRIVATE
+        ${${_target_logical_name}_HEADERS}
+        ${${_target_logical_name}_SOURCES}
     )
-    target_include_directories(${_target} PUBLIC "$<BUILD_INTERFACE:${${_target}_INCLUDE_DIRECTORIES}>")
-    target_include_directories(${_target} SYSTEM PRIVATE "$<BUILD_INTERFACE:${${_target}_SYSTEM_INCLUDE_DIRECTORIES}>")
-    target_include_directories(${_target} PRIVATE "$<BUILD_INTERFACE:${${_target}_PRIVATE_INCLUDE_DIRECTORIES}>")
-    target_link_libraries(${_target} ${${_target}_LIBRARIES})
-    set_target_properties(${_target} PROPERTIES COMPILE_DEFINITIONS "BUILDING_${_target}")
+    target_include_directories(${_target_cmake_name} PUBLIC "$<BUILD_INTERFACE:${${_target_logical_name}_INCLUDE_DIRECTORIES}>")
+    target_include_directories(${_target_cmake_name} SYSTEM PRIVATE "$<BUILD_INTERFACE:${${_target_logical_name}_SYSTEM_INCLUDE_DIRECTORIES}>")
+    target_include_directories(${_target_cmake_name} PRIVATE "$<BUILD_INTERFACE:${${_target_logical_name}_PRIVATE_INCLUDE_DIRECTORIES}>")
+
+    target_compile_definitions(${_target_cmake_name} PRIVATE "BUILDING_${_target_logical_name}")
+    if (${_target_logical_name}_DEFINITIONS)
+        target_compile_definitions(${_target_cmake_name} PUBLIC ${${_target_logical_name}_DEFINITIONS})
+    endif ()
+    if (${_target_logical_name}_PRIVATE_DEFINITIONS)
+        target_compile_definitions(${_target_cmake_name} PRIVATE ${${_target_logical_name}_PRIVATE_DEFINITIONS})
+    endif ()
+
+    target_link_libraries(${_target_cmake_name} ${${_target_logical_name}_LIBRARIES})
+
+    if (${_target}_DEPENDENCIES)
+        add_dependencies(${_target_cmake_name} ${${_target}_DEPENDENCIES})
+    endif ()
+endmacro()
+
+macro(WEBKIT_FRAMEWORK _target)
+    _WEBKIT_TARGET(${_target} ${_target})
 
     if (${_target}_OUTPUT_NAME)
         set_target_properties(${_target} PROPERTIES OUTPUT_NAME ${${_target}_OUTPUT_NAME})
@@ -172,6 +197,43 @@ macro(WEBKIT_FRAMEWORK _target)
     endif ()
 endmacro()
 
+macro(WEBKIT_EXECUTABLE _target)
+    _WEBKIT_TARGET(${_target} ${_target})
+
+    if (${_target}_OUTPUT_NAME)
+        set_target_properties(${_target} PROPERTIES OUTPUT_NAME ${${_target}_OUTPUT_NAME})
+    endif ()
+endmacro()
+
+macro(WEBKIT_WRAP_EXECUTABLE _target)
+    set(oneValueArgs TARGET_NAME)
+    set(multiValueArgs SOURCES LIBRARIES)
+    cmake_parse_arguments(opt "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+    if (opt_TARGET_NAME)
+        set(_wrapped_target_name ${opt_TARGET_NAME})
+    else ()
+        set(_wrapped_target_name ${_target}Lib)
+    endif ()
+
+    add_library(${_wrapped_target_name} SHARED "${CMAKE_BINARY_DIR}/cmakeconfig.h")
+
+    _WEBKIT_TARGET(${_target} ${_wrapped_target_name})
+
+    # Unset values
+    unset(${_target}_HEADERS)
+    unset(${_target}_DEFINITIONS)
+    unset(${_target}_PRIVATE_DEFINITIONS)
+    unset(${_target}_INCLUDE_DIRECTORIES)
+    unset(${_target}_SYSTEM_INCLUDE_DIRECTORIES)
+    unset(${_target}_PRIVATE_INCLUDE_DIRECTORIES)
+
+    # Reset the sources
+    set(${_target}_SOURCES ${opt_SOURCES})
+    set(${_target}_LIBRARIES ${opt_LIBRARIES})
+    set(${_target}_DEPENDENCIES ${_wrapped_target_name})
+endmacro()
+
 macro(WEBKIT_CREATE_FORWARDING_HEADER _target_directory _file)
     get_filename_component(_source_path "${CMAKE_SOURCE_DIR}/Source/" ABSOLUTE)
     get_filename_component(_absolute "${_file}" ABSOLUTE)