Skip to content

Commit 97ab293

Browse files
committed
SWPROT-8953: build: Allow packaging in project clients once
The client project should include cpack once, the change prevents double inclusion This help to use core as dependency for unify-z-wave It was made for v7 but can also apply to v6, let's align before core pull. Origin: #7 Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
1 parent d13231c commit 97ab293

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

cmake/include/package.cmake

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
message(STATUS "Components of Unify which will have deb packages"
22
": ${CPACK_COMPONENTS_ALL}")
33

4-
include(CPack)
4+
if(PROJECT_IS_TOP_LEVEL)
5+
message(STATUS "cpack: Included from ${CMAKE_SOURCE_DIR}")
6+
include(CPack)
57

6-
foreach(PKG_NAME IN LISTS CPACK_COMPONENTS_ALL)
7-
string(TOUPPER ${PKG_NAME} PKG_NAME_UPPER)
8-
cpack_add_component(
9-
PKG_NAME
10-
DISPLAY_NAME ${PKG_NAME}
11-
DESCRIPTION ${CPACK_DEBIAN_${PKG_NAME_UPPER}_DESCRIPTION}
12-
INSTALL_TYPES Full)
13-
endforeach()
8+
foreach(PKG_NAME IN LISTS CPACK_COMPONENTS_ALL)
9+
string(TOUPPER ${PKG_NAME} PKG_NAME_UPPER)
10+
cpack_add_component(
11+
PKG_NAME
12+
DISPLAY_NAME ${PKG_NAME}
13+
DESCRIPTION ${CPACK_DEBIAN_${PKG_NAME_UPPER}_DESCRIPTION}
14+
INSTALL_TYPES Full)
15+
endforeach()
16+
endif()

0 commit comments

Comments
 (0)