]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - shell/CMakeLists.txt
JavaScriptCore-1218.tar.gz
[apple/javascriptcore.git] / shell / CMakeLists.txt
index 85ad89a885255ea80266415416b052fa9e766fd3..fcbe429c0558a9bdd60ea211df7898a630e2a683 100644 (file)
@@ -1,28 +1,33 @@
-SET(JSC_SOURCES
+set(JSC_SOURCES
     ../jsc.cpp
 )
 
-SET(JSC_LIBRARIES
-    ${WTF_LIBRARY_NAME}
-    ${JavaScriptCore_LIBRARY_NAME}
+set(JSC_LIBRARIES
+    WTF
+    JavaScriptCore
+    ${CMAKE_DL_LIBS}
 )
 
+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_SOURCES})
-TARGET_LINK_LIBRARIES(${JSC_EXECUTABLE_NAME} ${JSC_LIBRARIES})
-SET_TARGET_PROPERTIES(${JSC_EXECUTABLE_NAME} PROPERTIES FOLDER "JavaScriptCore")
+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_LINK_FLAGS)
-    ADD_TARGET_PROPERTIES(${JSC_EXECUTABLE_NAME} LINK_FLAGS "${JSC_LINK_FLAGS}")
-ENDIF ()
+if (JSC_OUTPUT_NAME)
+    set_target_properties(jsc PROPERTIES OUTPUT_NAME ${JSC_OUTPUT_NAME})
+endif ()
 
-IF ("${PORT}" STREQUAL "Efl")
-    SET_TARGET_PROPERTIES(${JSC_EXECUTABLE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
-ENDIF ()
+if (JSC_LINK_FLAGS)
+    ADD_TARGET_PROPERTIES(jsc LINK_FLAGS "${JSC_LINK_FLAGS}")
+endif ()
 
-IF (SHOULD_INSTALL_JS_SHELL)
-    INSTALL(TARGETS ${JSC_EXECUTABLE_NAME} DESTINATION bin)
-ENDIF ()
+if (SHOULD_INSTALL_JS_SHELL)
+    install(TARGETS jsc DESTINATION "${EXEC_INSTALL_DIR}")
+endif ()