Skip to content

Commit

Permalink
build fix: Installing the static lib will also install headers (#1948)
Browse files Browse the repository at this point in the history
Installing the static lib will also install headers (Fixes: #1896).

This is useful for debian's iotjs-dev package. The extra archive rule is needed to prevent this error:
   install TARGETS given no ARCHIVE DESTINATION for static library target

Change-Id: Ib9f6cb50631f4cdfeb308108f91ed28e7d204dc4
Forwarded: #1948
Origin: https://github.com/TizenTeam/iotjs/tree/sandbox/rzr/cmake/lib/review/master
Bug: #1945
Bug-Debian: https://bugs.debian.org/957364
Relate-to: #1896
Last-Update: 2020-10-16

IoT.js-DCO-1.0-Signed-off-by: Philippe Coval rzr@users.sf.net
  • Loading branch information
rzr committed May 12, 2021
1 parent c8a49ce commit 403f55b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cmake/iotjs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -580,16 +580,11 @@ 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}
install(TARGETS ${TARGET_IOTJS} ${TARGET_LIB_IOTJS}
RUNTIME DESTINATION "${INSTALL_PREFIX}/bin"
ARCHIVE DESTINATION "${INSTALL_PREFIX}/lib"
LIBRARY DESTINATION "${INSTALL_PREFIX}/lib"
PUBLIC_HEADER DESTINATION "${INSTALL_PREFIX}/include/iotjs")
if(CREATE_SHARED_LIB)
install(TARGETS ${TARGET_LIB_IOTJS}
RUNTIME DESTINATION "${INSTALL_PREFIX}/bin"
LIBRARY DESTINATION "${INSTALL_PREFIX}/lib"
PUBLIC_HEADER DESTINATION "${INSTALL_PREFIX}/include/iotjs")
endif()
else()
install(TARGETS ${TARGET_LIB_IOTJS} DESTINATION ${LIB_INSTALL_DIR})
endif()

0 comments on commit 403f55b

Please sign in to comment.