Skip to content

Commit 403f55b

Browse files
authored
build fix: Installing the static lib will also install headers (#1948)
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 [email protected]
1 parent c8a49ce commit 403f55b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

cmake/iotjs.cmake

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -580,16 +580,11 @@ if(NOT BUILD_LIB_ONLY)
580580
)
581581
target_include_directories(${TARGET_IOTJS} PRIVATE ${IOTJS_INCLUDE_DIRS})
582582
target_link_libraries(${TARGET_IOTJS} ${TARGET_LIB_IOTJS})
583-
install(TARGETS ${TARGET_IOTJS}
583+
install(TARGETS ${TARGET_IOTJS} ${TARGET_LIB_IOTJS}
584584
RUNTIME DESTINATION "${INSTALL_PREFIX}/bin"
585+
ARCHIVE DESTINATION "${INSTALL_PREFIX}/lib"
585586
LIBRARY DESTINATION "${INSTALL_PREFIX}/lib"
586587
PUBLIC_HEADER DESTINATION "${INSTALL_PREFIX}/include/iotjs")
587-
if(CREATE_SHARED_LIB)
588-
install(TARGETS ${TARGET_LIB_IOTJS}
589-
RUNTIME DESTINATION "${INSTALL_PREFIX}/bin"
590-
LIBRARY DESTINATION "${INSTALL_PREFIX}/lib"
591-
PUBLIC_HEADER DESTINATION "${INSTALL_PREFIX}/include/iotjs")
592-
endif()
593588
else()
594589
install(TARGETS ${TARGET_LIB_IOTJS} DESTINATION ${LIB_INSTALL_DIR})
595590
endif()

0 commit comments

Comments
 (0)