Skip to content

Commit

Permalink
iotjs: Install binaries to system (#1134)
Browse files Browse the repository at this point in the history
This will be helpful for packaging,
for example on Tizen install using RPM macro: "%make_install"
or Debian's debhelper.

Work along CMAKE_INSTALL_PREFIX,
or/and can be overloaded individualy to alternate locations.

IoT.js-DCO-1.0-Signed-off-by: Philippe Coval philippe.coval@osg.samsung.com
  • Loading branch information
rzr authored and yichoi committed Aug 25, 2017
1 parent f00efac commit 465c369
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmake/iotjs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,16 @@ target_link_libraries(${TARGET_LIB_IOTJS}
${EXTERNAL_SHARED_LIB}
)

if("${LIB_INSTALL_DIR}" STREQUAL "")
set(LIB_INSTALL_DIR "lib")
endif()

if("${BIN_INSTALL_DIR}" STREQUAL "")
set(BIN_INSTALL_DIR "bin")
endif()

install(TARGETS ${TARGET_LIB_IOTJS} DESTINATION ${LIB_INSTALL_DIR})

if(NOT BUILD_LIB_ONLY)

if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
Expand All @@ -275,4 +285,5 @@ if(NOT BUILD_LIB_ONLY)
)
target_include_directories(${TARGET_IOTJS} PRIVATE ${IOTJS_INCLUDE_DIRS})
target_link_libraries(${TARGET_IOTJS} ${TARGET_LIB_IOTJS})
install(TARGETS ${TARGET_IOTJS} DESTINATION ${BIN_INSTALL_DIR})
endif()

0 comments on commit 465c369

Please sign in to comment.