Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN true)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
# Automatically add the current source and build dirs to the private and
# interface include directories.
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)

include(ctest/CMakeLists.txt)

Expand Down Expand Up @@ -126,3 +130,4 @@ add_subdirectory(doc)
add_subdirectory(schemas)

add_subdirectory(cpack)
add_subdirectory(cmake)
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ build_script:
# %INSTALL%\bin is where parameter.dll is installed
# Also add the path where the release libxml2.dll has been extracted
- set TEST_PATH=%RELEASE_LIBXML2_PATH%\bin;%INSTALL%\lib;%INSTALL%\bin
- cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=%INSTALL% -DCMAKE_PREFIX_PATH=%INSTALL% %APPVEYOR_BUILD_FOLDER%\skeleton-subsystem
- cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=%INSTALL% -DCMAKE_PREFIX_PATH="%INSTALL%;%RELEASE_LIBXML2_PATH%" %APPVEYOR_BUILD_FOLDER%\skeleton-subsystem
# Unfortunately, the skeleton test currently doesn't work on
# multi-configuration build systems (Visual Studio is one of those) without
# installing the plugin
Expand Down
2 changes: 1 addition & 1 deletion asio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if (NETWORKING)

# Ubuntu 14.04 packages asio 1.10.1 and clang 3.4.1.
# In this environment, asio stand alone (set ASIO_STANDALONE)
# does not correcly detect that the stl has CHRONO support (c++11).
# does not correctly detect that the stl has CHRONO support (c++11).
# Force the use of std::chrono by setting ASIO_HAS_STD_CHRONO
target_include_directories(asio SYSTEM INTERFACE "${ASIO_DIR}")
target_link_libraries(asio INTERFACE "${CMAKE_THREAD_LIBS_INIT}")
Expand Down
6 changes: 0 additions & 6 deletions bindings/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ install(FILES ParameterFramework.h

target_link_libraries(cparameter PRIVATE parameter pfw_utility)

target_include_directories(cparameter
# Fixme use an include folder
PUBLIC .
# Export symbol macro header
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")

install(TARGETS cparameter LIBRARY DESTINATION lib RUNTIME DESTINATION bin)

if(BUILD_TESTING)
Expand Down
50 changes: 50 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright (c) 2016, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

configure_file(ParameterFrameworkConfig.cmake
"${CMAKE_CURRENT_BINARY_DIR}/ParameterFrameworkConfig.cmake"
COPYONLY
)

include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/ParameterFrameworkConfigVersion.cmake"
VERSION ${PF_VERSION_MAJOR}.${PF_VERSION_MINOR}.${PF_VERSION_PATCH}
COMPATIBILITY SameMajorVersion)

export(EXPORT ParameterTargets
FILE "${CMAKE_CURRENT_BINARY_DIR}/ParameterFrameworkTargets.cmake"
NAMESPACE ParameterFramework::)

install(EXPORT ParameterTargets DESTINATION lib/cmake/ParameterFramework
FILE ParameterFrameworkTargets.cmake
NAMESPACE ParameterFramework::)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/ParameterFrameworkConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/ParameterFrameworkConfigVersion.cmake"
DESTINATION lib/cmake/ParameterFramework)
29 changes: 29 additions & 0 deletions cmake/ParameterFrameworkConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) 2016, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

include("${CMAKE_CURRENT_LIST_DIR}/ParameterFrameworkTargets.cmake")
2 changes: 1 addition & 1 deletion ctest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function(set_test_env TestName)
endif()


# With nmake and nmake, executables are build in:
# With nmake and nmake, executables are built in:
# ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} => `bin/`
#
# Nevertheless Visual studio (and xcode) can build for debug and release
Expand Down
32 changes: 22 additions & 10 deletions parameter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,32 @@ endif()
configure_file(version.h.in "${CMAKE_CURRENT_BINARY_DIR}/version.h")

target_link_libraries(parameter
# Unfortunatly xmlSink and xmlSource need to be exposed to the plugins
PUBLIC xmlserializer
PRIVATE pfw_utility remote-processor
PRIVATE xmlserializer pfw_utility remote-processor
PRIVATE ${CMAKE_DL_LIBS})

target_include_directories(parameter
PUBLIC include log/include
# Export symbol macro header
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}"
# FIXE: define . as an PUBLIC include directory only for plugins
PUBLIC .)
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/log/include>)

install(TARGETS parameter EXPORT ParameterTargets
LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib
INCLUDES DESTINATION "include/parameter/client" "include/parameter/plugin")

# Export an interface library for plugins to use (after the ParameterFramework
# project is built and installed). It makes them link against libparameter and
# use xmlserializer's and pfw_utilify's include directories.
add_library(plugin INTERFACE)
target_link_libraries(plugin INTERFACE parameter)
install(TARGETS plugin EXPORT ParameterTargets
INCLUDES DESTINATION "include/parameter/xmlserializer" "include/parameter/utility")
# Unfortunately, while the "plugin" interface library is suitable for external
# plugins (built using the installed Parameter Framework) we want to build some
# plugins before the whole project is installed. Therefore, they need to get
# xmlserializer's and pfw_utility's headers from the build tree. This
# "plugin-internal-hack" is for them.
add_library(plugin-internal-hack INTERFACE)
target_link_libraries(plugin-internal-hack INTERFACE parameter xmlserializer)

install(TARGETS parameter LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib)
# Client headers
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/parameter_export.h"
Expand All @@ -161,7 +174,6 @@ install(FILES
Element.h
ElementBuilder.h
ElementLibrary.h
FileIncluderElementBuilder.h
FormattedSubsystemObject.h
InstanceConfigurableElement.h
LoggingElementBuilderTemplate.h
Expand Down
9 changes: 2 additions & 7 deletions remote-processor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ generate_export_header(remote-processor
set(CMAKE_THREAD_PREFER_PTHREAD 1)
find_package(Threads REQUIRED)

target_include_directories(remote-processor
# Symbol export macro header
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}"
# TODO: separate remote-processor's includes in half (public/private)
PUBLIC .)

target_link_libraries(remote-processor PRIVATE pfw_utility asio ${CMAKE_THREAD_LIBS_INIT})

install(TARGETS remote-processor LIBRARY DESTINATION lib RUNTIME DESTINATION bin)
install(TARGETS remote-processor EXPORT ParameterTargets
LIBRARY DESTINATION lib RUNTIME DESTINATION bin)
19 changes: 4 additions & 15 deletions skeleton-subsystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ cmake_minimum_required(VERSION 2.8.12)

project(parameter-framework-plugins-skeleton)

find_package(ParameterFramework REQUIRED)

if(WIN32)
# Force include iso646.h to support alternative operator form (and, or, not...)
# Such support is require by the standard and can be enabled with /Za
Expand All @@ -45,29 +47,16 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN true)

# Force libs and executable to all be at a known place - simplifies a lot of
# things, expecially setting the test environment
# things, especially setting the test environment
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)

#
# Find PFW libraries and include directories
#
find_path(PFW_INCLUDE_ROOT NAMES parameter/plugin/Plugin.h)

find_library(PFW_CORE_LIBRARY NAMES parameter)

set(PFW_INCLUDE_DIRS
${PFW_INCLUDE_ROOT}/parameter/plugin
${PFW_INCLUDE_ROOT}/xmlserializer
${PFW_INCLUDE_ROOT}/utility)

add_library(skeleton-subsystem MODULE
SkeletonSubsystemBuilder.cpp
SkeletonSubsystem.cpp
SkeletonSubsystemObject.cpp)

target_include_directories(skeleton-subsystem PRIVATE ${PFW_INCLUDE_DIRS})
target_link_libraries(skeleton-subsystem ${PFW_CORE_LIBRARY})
target_link_libraries(skeleton-subsystem PRIVATE ParameterFramework::plugin)

install(TARGETS skeleton-subsystem
LIBRARY DESTINATION lib
Expand Down
3 changes: 1 addition & 2 deletions skeleton-subsystem/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ configure_file(structure.xml "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY)
configure_file(toplevel.xml "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY)

add_executable(skeleton-test main.cpp)
target_include_directories(skeleton-test PRIVATE "${PFW_INCLUDE_ROOT}/parameter/client")
target_link_libraries(skeleton-test "${PFW_CORE_LIBRARY}")
target_link_libraries(skeleton-test PRIVATE ParameterFramework::parameter)

add_test(NAME skeleton-test
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
Expand Down
3 changes: 2 additions & 1 deletion test/functional-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ if(BUILD_TESTING)
find_package(LibXml2 REQUIRED)

target_link_libraries(parameterFunctionalTest
PRIVATE parameter catch tmpfile LibXml2::libxml2 introspection-subsystem)
PRIVATE parameter
PRIVATE pfw_utility catch tmpfile LibXml2::libxml2 introspection-subsystem)

add_test(NAME parameterFunctionalTest
COMMAND parameterFunctionalTest)
Expand Down
4 changes: 2 additions & 2 deletions test/introspection-subsystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if (BUILD_TESTING)
#
# Note : headers located in root project directory remain private.
target_include_directories(introspection-subsystem
PUBLIC "include" "${CMAKE_CURRENT_BINARY_DIR}")
PUBLIC "include")

target_link_libraries(introspection-subsystem PRIVATE parameter)
target_link_libraries(introspection-subsystem PRIVATE plugin-internal-hack)
endif()
2 changes: 1 addition & 1 deletion test/test-subsystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ if (BUILD_TESTING)
TESTSubsystemString.cpp
TESTSubsystemBuilder.cpp)

target_link_libraries(test-subsystem PRIVATE parameter)
target_link_libraries(test-subsystem PRIVATE plugin-internal-hack)
endif()
1 change: 0 additions & 1 deletion test/tmpfile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ if(BUILD_TESTING)
endif ()

add_library(tmpfile STATIC ${OS_SPECIFIC_TMPFILE})
target_include_directories(tmpfile PUBLIC .)
endif()
4 changes: 1 addition & 3 deletions utility/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ add_library(pfw_utility STATIC
Utility.cpp
DynamicLibrary.cpp)

target_include_directories(pfw_utility PUBLIC .)

# Needed for linking against shared libraries on Linux (no-op on Windows)
set_target_properties(pfw_utility PROPERTIES POSITION_INDEPENDENT_CODE TRUE)

Expand All @@ -48,7 +46,7 @@ install(FILES
ErrorContext.hpp
Utility.h
convert.hpp
DESTINATION "include/utility")
DESTINATION "include/parameter/utility")

if(BUILD_TESTING)
# Add unit test
Expand Down
5 changes: 1 addition & 4 deletions xmlserializer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,13 @@ if(NOT XML2_XINCLUDE_SUPPORT)
"please install a version of libxml2 supporting it.")
endif()

target_include_directories(xmlserializer PUBLIC .)

target_link_libraries(xmlserializer
PUBLIC pfw_utility # For NonCopyable and ErrorContext
PRIVATE LibXml2::libxml2)


install(FILES
XmlSink.h
XmlSource.h
XmlElement.h
XmlSerializingContext.h
DESTINATION "include/xmlserializer")
DESTINATION "include/parameter/xmlserializer")