Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit d7b718a

Browse files
committed
Merge pull request #367 from dawagner/cpack-components
The following components are declared: runtime (libparameter and libremote-processor); dev (everything necessary to develop a plugin or a client: headers, cmake package files, ...); c (the C bindings, i.e. libcparameter); cdev (everything necessary to develop a client using the C bindings); python (the Python bindings); eng (the various tools, XML schemas, ...); runtime-deps (on windows only: the msvc redistributable files). Then, CPack can be used to generate separate packages.
2 parents 1d51444 + bf2c083 commit d7b718a

File tree

15 files changed

+53
-24
lines changed

15 files changed

+53
-24
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ script:
118118
cmake $MY_CMAKE_OPTIONS . &&
119119
make &&
120120
make install ); fi
121+
# Check that all installed files are in a component (no "unspecified
122+
# component" archive created)
123+
- (cd build && cpack -G TGZ -D CPACK_ARCHIVE_COMPONENT_INSTALL=ON &&
124+
[ ! -a '*-Unspecified.tar.gz' ])
121125
# Keep this last
122126
- ( mkdir build_less_features && cd build_less_features &&
123127
rm -rf $PREFIX/asio-1.10.6 &&

bindings/c/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ generate_export_header(cparameter)
3333

3434
install(FILES ParameterFramework.h
3535
"${CMAKE_CURRENT_BINARY_DIR}/cparameter_export.h"
36-
DESTINATION "include/parameter/c")
36+
DESTINATION "include/parameter/c"
37+
COMPONENT c_dev)
3738

3839
target_link_libraries(cparameter PRIVATE parameter pfw_utility)
3940

40-
install(TARGETS cparameter LIBRARY DESTINATION lib RUNTIME DESTINATION bin)
41+
install(TARGETS cparameter
42+
LIBRARY DESTINATION lib COMPONENT c
43+
RUNTIME DESTINATION bin COMPONENT c
44+
ARCHIVE DESTINATION lib COMPONENT c_dev)
4145

4246
if(BUILD_TESTING)
4347
# Add unit test

bindings/python/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ execute_process(COMMAND
8989
print(sysconfig.get_python_lib(plat_specific=True, prefix=''))"
9090
OUTPUT_VARIABLE PYTHON_MODULE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
9191

92-
install(TARGETS _PyPfw LIBRARY DESTINATION ${PYTHON_MODULE_PATH})
92+
install(TARGETS _PyPfw LIBRARY DESTINATION ${PYTHON_MODULE_PATH} COMPONENT python)
9393

9494
# install the generated Python file as well
95-
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PyPfw.py DESTINATION ${PYTHON_MODULE_PATH})
95+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PyPfw.py DESTINATION ${PYTHON_MODULE_PATH}
96+
COMPONENT python)

cmake/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ export(EXPORT ParameterTargets
4343

4444
install(EXPORT ParameterTargets DESTINATION lib/cmake/ParameterFramework
4545
FILE ParameterFrameworkTargets.cmake
46-
NAMESPACE ParameterFramework::)
46+
NAMESPACE ParameterFramework::
47+
COMPONENT dev)
4748
install(FILES
4849
"${CMAKE_CURRENT_BINARY_DIR}/ParameterFrameworkConfig.cmake"
4950
"${CMAKE_CURRENT_BINARY_DIR}/ParameterFrameworkConfigVersion.cmake"
50-
DESTINATION lib/cmake/ParameterFramework)
51+
DESTINATION lib/cmake/ParameterFramework
52+
COMPONENT dev)

cpack/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ set(CPACK_WIX_UPGRADE_GUID "47E60D10-B344-445D-A2F6-5684CC8B1D47")
4747

4848
if (WIN32)
4949
# On windows, pack compiler provided libraries (MSVC redistributable) with the project
50+
# Have cpack make a specific archive for them
51+
set(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT runtime_deps)
5052
include(InstallRequiredSystemLibraries)
5153
# TODO: pack libxml2.dll with the project
5254
endif()

parameter/CMakeLists.txt

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,24 @@ target_link_libraries(parameter
132132

133133
target_include_directories(parameter
134134
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
135-
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/log/include>)
135+
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/log/include>
136+
INTERFACE $<INSTALL_INTERFACE:include/parameter/client>
137+
INTERFACE $<INSTALL_INTERFACE:include/parameter/plugin>)
136138

137139
install(TARGETS parameter EXPORT ParameterTargets
138-
LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib
139-
INCLUDES DESTINATION "include/parameter/client" "include/parameter/plugin")
140+
LIBRARY DESTINATION lib COMPONENT runtime
141+
RUNTIME DESTINATION bin COMPONENT runtime
142+
ARCHIVE DESTINATION lib COMPONENT dev)
140143

141144
# Export an interface library for plugins to use (after the ParameterFramework
142145
# project is built and installed). It makes them link against libparameter and
143146
# use xmlserializer's and pfw_utilify's include directories.
144147
add_library(plugin INTERFACE)
145148
target_link_libraries(plugin INTERFACE parameter)
146-
install(TARGETS plugin EXPORT ParameterTargets
147-
INCLUDES DESTINATION "include/parameter/xmlserializer" "include/parameter/utility")
149+
target_include_directories(plugin
150+
INTERFACE $<INSTALL_INTERFACE:include/parameter/xmlserializer>
151+
INTERFACE $<INSTALL_INTERFACE:include/parameter/utility>)
152+
install(TARGETS plugin EXPORT ParameterTargets COMPONENT dev)
148153
# Unfortunately, while the "plugin" interface library is suitable for external
149154
# plugins (built using the installed Parameter Framework) we want to build some
150155
# plugins before the whole project is installed. Therefore, they need to get
@@ -164,7 +169,8 @@ install(FILES
164169
include/ParameterMgrPlatformConnector.h
165170
include/SelectionCriterionInterface.h
166171
include/SelectionCriterionTypeInterface.h
167-
DESTINATION "include/parameter/client")
172+
DESTINATION "include/parameter/client"
173+
COMPONENT dev)
168174
# Core (plugin) headers
169175
install(FILES
170176
"${CMAKE_CURRENT_BINARY_DIR}/parameter_export.h"
@@ -191,6 +197,8 @@ install(FILES
191197
Syncer.h
192198
TypeElement.h
193199
VirtualSubsystem.h
194-
DESTINATION "include/parameter/plugin")
200+
DESTINATION "include/parameter/plugin"
201+
COMPONENT dev)
195202
install(DIRECTORY log/include/log/
196-
DESTINATION "include/parameter/plugin/log")
203+
DESTINATION "include/parameter/plugin/log"
204+
COMPONENT dev)

remote-process/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ if(NETWORKING)
3535
target_link_libraries(remote-process
3636
PRIVATE remote-processor pfw_utility asio ${CMAKE_THREAD_LIBS_INIT})
3737

38-
install(TARGETS remote-process RUNTIME DESTINATION bin)
38+
install(TARGETS remote-process RUNTIME DESTINATION bin
39+
COMPONENT eng)
3940
endif()

remote-processor/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ find_package(Threads REQUIRED)
4343
target_link_libraries(remote-processor PRIVATE pfw_utility asio ${CMAKE_THREAD_LIBS_INIT})
4444

4545
install(TARGETS remote-processor EXPORT ParameterTargets
46-
LIBRARY DESTINATION lib RUNTIME DESTINATION bin)
46+
LIBRARY DESTINATION lib COMPONENT runtime
47+
RUNTIME DESTINATION bin COMPONENT runtime
48+
ARCHIVE DESTINATION lib COMPONENT dev)

schemas/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ install(FILES ComponentLibrary.xsd
3737
Subsystem.xsd
3838
SystemClass.xsd
3939
W3cXmlAttributes.xsd
40-
DESTINATION share/${PROJECT_NAME}/schemas)
40+
DESTINATION share/${PROJECT_NAME}/schemas
41+
COMPONENT eng)

test/test-platform/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ if(NETWORKING)
3636
# Workaround because asio is still leaking to test-platform
3737
target_link_libraries(test-platform PRIVATE asio)
3838

39-
install(TARGETS test-platform RUNTIME DESTINATION bin)
39+
install(TARGETS test-platform RUNTIME DESTINATION bin COMPONENT eng)
4040
endif()

0 commit comments

Comments
 (0)