• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2014-2015, Intel Corporation
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without modification,
5# are permitted provided that the following conditions are met:
6#
7# 1. Redistributions of source code must retain the above copyright notice, this
8# list of conditions and the following disclaimer.
9#
10# 2. Redistributions in binary form must reproduce the above copyright notice,
11# this list of conditions and the following disclaimer in the documentation and/or
12# other materials provided with the distribution.
13#
14# 3. Neither the name of the copyright holder nor the names of its contributors
15# may be used to endorse or promote products derived from this software without
16# specific prior written permission.
17#
18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
22# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29if(WIN32)
30    set(parameter_RESOURCE_FILE "${CMAKE_CURRENT_BINARY_DIR}/Resource.rc")
31    set(parameter_OS_SPECIFIC_SRCS ${parameter_RESOURCE_FILE})
32endif()
33
34add_library(parameter SHARED
35    ${parameter_OS_SPECIFIC_SRCS}
36    AreaConfiguration.cpp
37    ArrayParameter.cpp
38    BaseIntegerParameterType.cpp
39    BaseParameter.cpp
40    BitParameterBlock.cpp
41    BitParameterBlockType.cpp
42    BitParameter.cpp
43    BitParameterType.cpp
44    BitwiseAreaConfiguration.cpp
45    BooleanParameterType.cpp
46    CommandHandlerWrapper.cpp
47    ComponentInstance.cpp
48    ComponentLibrary.cpp
49    ComponentType.cpp
50    CompoundRule.cpp
51    ConfigurableDomain.cpp
52    ConfigurableDomains.cpp
53    ConfigurableElementAggregator.cpp
54    ConfigurableElement.cpp
55    ConfigurationAccessContext.cpp
56    DomainConfiguration.cpp
57    Element.cpp
58    ElementLibrary.cpp
59    ElementLibrarySet.cpp
60    ElementLocator.cpp
61    EnumParameterType.cpp
62    EnumValuePair.cpp
63    FixedPointParameterType.cpp
64    FloatingPointParameterType.cpp
65    FormattedSubsystemObject.cpp
66    FrameworkConfigurationLocation.cpp
67    HardwareBackSynchronizer.cpp
68    InstanceConfigurableElement.cpp
69    InstanceDefinition.cpp
70    LinearParameterAdaptation.cpp
71    LogarithmicParameterAdaptation.cpp
72    LoggingElementBuilderTemplate.cpp
73    MappingContext.cpp
74    MappingData.cpp
75    ParameterAccessContext.cpp
76    ParameterAdaptation.cpp
77    ParameterBlackboard.cpp
78    ParameterBlockType.cpp
79    Parameter.cpp
80    ParameterFrameworkConfiguration.cpp
81    ElementHandle.cpp
82    ParameterMgr.cpp
83    ParameterMgrFullConnector.cpp
84    ParameterMgrPlatformConnector.cpp
85    ParameterType.cpp
86    PathNavigator.cpp
87    PluginLocation.cpp
88    RuleParser.cpp
89    SelectionCriteria.cpp
90    SelectionCriteriaDefinition.cpp
91    SelectionCriterion.cpp
92    SelectionCriterionLibrary.cpp
93    SelectionCriterionRule.cpp
94    SelectionCriterionType.cpp
95    SimulatedBackSynchronizer.cpp
96    StringParameter.cpp
97    StringParameterType.cpp
98    Subsystem.cpp
99    SubsystemElementBuilder.cpp
100    SubsystemObject.cpp
101    SubsystemObjectCreator.cpp
102    SyncerSet.cpp
103    SystemClass.cpp
104    TypeElement.cpp
105    VirtualSubsystem.cpp
106    VirtualSyncer.cpp
107    XmlElementSerializingContext.cpp
108    XmlFileIncluderElement.cpp
109    XmlParameterSerializingContext.cpp)
110
111include(GenerateExportHeader)
112generate_export_header(parameter)
113
114if(WIN32)
115    set(WINRC_MAJOR ${PF_VERSION_MAJOR})
116    set(WINRC_MINOR ${PF_VERSION_MINOR})
117    set(WINRC_PATCH ${PF_VERSION_PATCH})
118    set(WINRC_TWEAK ${PF_VERSION_TWEAK})
119    target_compile_definitions(parameter PRIVATE
120        WINRC_DLL
121        WINRC_FILENAME="$<TARGET_FILE_NAME:parameter>")
122    set(WINRC_FILE_DESCRIPTION "Parameter Framework library")
123    configure_file("${PROJECT_SOURCE_DIR}/support/windows/Resource.rc.in"
124                   "${parameter_RESOURCE_FILE}")
125endif()
126
127configure_file(version.h.in "${CMAKE_CURRENT_BINARY_DIR}/version.h")
128
129target_link_libraries(parameter
130    PRIVATE xmlserializer pfw_utility remote-processor
131    PRIVATE ${CMAKE_DL_LIBS})
132
133target_include_directories(parameter
134    PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/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>)
138
139install(TARGETS parameter EXPORT ParameterTargets
140    LIBRARY DESTINATION lib COMPONENT runtime
141    RUNTIME DESTINATION bin COMPONENT runtime
142    ARCHIVE DESTINATION lib COMPONENT dev)
143
144# Export an interface library for plugins to use (after the ParameterFramework
145# project is built and installed). It makes them link against libparameter and
146# use xmlserializer's and pfw_utilify's include directories.
147add_library(plugin INTERFACE)
148target_link_libraries(plugin INTERFACE parameter)
149target_include_directories(plugin
150    INTERFACE $<INSTALL_INTERFACE:include/parameter/xmlserializer>
151    INTERFACE $<INSTALL_INTERFACE:include/parameter/utility>)
152install(TARGETS plugin EXPORT ParameterTargets COMPONENT dev)
153# Unfortunately, while the "plugin" interface library is suitable for external
154# plugins (built using the installed Parameter Framework) we want to build some
155# plugins before the whole project is installed. Therefore, they need to get
156# xmlserializer's and pfw_utility's headers from the build tree. This
157# "plugin-internal-hack" is for them.
158add_library(plugin-internal-hack INTERFACE)
159target_link_libraries(plugin-internal-hack INTERFACE parameter xmlserializer)
160
161# Client headers
162install(FILES
163    "${CMAKE_CURRENT_BINARY_DIR}/parameter_export.h"
164    include/CommandHandlerInterface.h
165    include/ElementHandle.h
166    include/ParameterHandle.h
167    include/ParameterMgrLoggerForward.h
168    include/ParameterMgrFullConnector.h
169    include/ParameterMgrPlatformConnector.h
170    include/SelectionCriterionInterface.h
171    include/SelectionCriterionTypeInterface.h
172    DESTINATION "include/parameter/client"
173    COMPONENT dev)
174# Core (plugin) headers
175install(FILES
176    "${CMAKE_CURRENT_BINARY_DIR}/parameter_export.h"
177    BitParameterBlockType.h
178    ConfigurableElement.h
179    DefaultElementLibrary.h
180    Element.h
181    ElementBuilder.h
182    ElementLibrary.h
183    FormattedSubsystemObject.h
184    InstanceConfigurableElement.h
185    LoggingElementBuilderTemplate.h
186    Mapper.h
187    MappingContext.h
188    ParameterBlockType.h
189    ParameterType.h
190    PathNavigator.h
191    Plugin.h
192    Subsystem.h
193    SubsystemLibrary.h
194    SubsystemObject.h
195    SubsystemObjectCreator.h
196    SubsystemObjectFactory.h
197    Syncer.h
198    TypeElement.h
199    VirtualSubsystem.h
200    DESTINATION "include/parameter/plugin"
201    COMPONENT dev)
202install(DIRECTORY log/include/log/
203        DESTINATION "include/parameter/plugin/log"
204        COMPONENT dev)
205