CMake: Add support to optionally install the built JavaScript shell
[WebKit-https.git] / Source / JavaScriptCore / shell / CMakeLists.txt
1 SET(JSC_HEADERS
2 )
3
4 SET(JSC_SOURCES
5     ../jsc.cpp
6 )
7
8 SET(JSC_LIBRARIES
9     ${JavaScriptCore_LIBRARY_NAME}
10 )
11
12 INCLUDE_IF_EXISTS(${JAVASCRIPTCORE_DIR}/shell/CMakeLists${PORT}.txt)
13
14 WEBKIT_WRAP_SOURCELIST(${JSC_SOURCES})
15 INCLUDE_DIRECTORIES(./ ${JavaScriptCore_INCLUDE_DIRECTORIES})
16 ADD_EXECUTABLE(${JSC_EXECUTABLE_NAME} ${JSC_HEADERS} ${JSC_SOURCES})
17 TARGET_LINK_LIBRARIES(${JSC_EXECUTABLE_NAME} ${JSC_LIBRARIES})
18
19 IF (JSC_LINK_FLAGS)
20     ADD_TARGET_PROPERTIES(${JSC_EXECUTABLE_NAME} LINK_FLAGS "${JSC_LINK_FLAGS}")
21 ENDIF ()
22
23 IF (SHARED_CORE)
24     SET_TARGET_PROPERTIES(${JSC_EXECUTABLE_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
25 ENDIF ()
26
27 IF (SHOULD_INSTALL_JS_SHELL)
28     INSTALL(TARGETS ${JSC_EXECUTABLE_NAME} DESTINATION bin)
29 ENDIF ()