-SET(JSC_HEADERS
-)
-
-SET(JSC_SOURCES
+set(JSC_SOURCES
../jsc.cpp
)
-SET(JSC_LIBRARIES
- ${JavaScriptCore_LIBRARY_NAME}
+set(JSC_LIBRARIES
+ WTF
+ JavaScriptCore
+ ${CMAKE_DL_LIBS}
)
-INCLUDE_IF_EXISTS(${JAVASCRIPTCORE_DIR}/shell/CMakeLists${PORT}.txt)
+if ("${JavaScriptCore_LIBRARY_TYPE}" MATCHES "STATIC")
+ add_definitions(-DSTATICALLY_LINKED_WITH_JavaScriptCore)
+endif ()
+
+WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
WEBKIT_WRAP_SOURCELIST(${JSC_SOURCES})
-INCLUDE_DIRECTORIES(./ ${JavaScriptCore_INCLUDE_DIRECTORIES})
-ADD_EXECUTABLE(${JSC_EXECUTABLE_NAME} ${JSC_HEADERS} ${JSC_SOURCES})
-TARGET_LINK_LIBRARIES(${JSC_EXECUTABLE_NAME} ${JSC_LIBRARIES})
+include_directories(./ ${JavaScriptCore_INCLUDE_DIRECTORIES})
+add_executable(jsc ${JSC_SOURCES})
+target_link_libraries(jsc ${JSC_LIBRARIES})
+set_target_properties(jsc PROPERTIES FOLDER "JavaScriptCore")
+
+if (JSC_OUTPUT_NAME)
+ set_target_properties(jsc PROPERTIES OUTPUT_NAME ${JSC_OUTPUT_NAME})
+endif ()
-IF (JSC_LINK_FLAGS)
- ADD_TARGET_PROPERTIES(${JSC_EXECUTABLE_NAME} LINK_FLAGS "${JSC_LINK_FLAGS}")
-ENDIF ()
+if (JSC_LINK_FLAGS)
+ ADD_TARGET_PROPERTIES(jsc LINK_FLAGS "${JSC_LINK_FLAGS}")
+endif ()
-IF (SHARED_CORE)
- SET_TARGET_PROPERTIES(${JSC_EXECUTABLE_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
-ENDIF ()
+if (SHOULD_INSTALL_JS_SHELL)
+ install(TARGETS jsc DESTINATION "${EXEC_INSTALL_DIR}")
+endif ()