From 96486ae6fc5dd7c591087b9f07aca89d20945cc3 Mon Sep 17 00:00:00 2001 From: David Wagner Date: Fri, 18 Mar 2016 18:13:50 +0100 Subject: [PATCH 1/6] Remove FileIncluderElementBuilder.h from installed headers It isn't supposed to be used by anyone (client or plugin). Signed-off-by: David Wagner --- parameter/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/parameter/CMakeLists.txt b/parameter/CMakeLists.txt index 230dd5ff4..69f8df93f 100644 --- a/parameter/CMakeLists.txt +++ b/parameter/CMakeLists.txt @@ -161,7 +161,6 @@ install(FILES Element.h ElementBuilder.h ElementLibrary.h - FileIncluderElementBuilder.h FormattedSubsystemObject.h InstanceConfigurableElement.h LoggingElementBuilderTemplate.h From 1f4e125bace03dc99d6f0e27bab2c030a2fcd83f Mon Sep 17 00:00:00 2001 From: David Wagner Date: Tue, 22 Mar 2016 12:48:00 +0100 Subject: [PATCH 2/6] Fix some typos in the makefiles Signed-off-by: David Wagner --- asio/CMakeLists.txt | 2 +- ctest/CMakeLists.txt | 2 +- parameter/CMakeLists.txt | 2 +- skeleton-subsystem/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/asio/CMakeLists.txt b/asio/CMakeLists.txt index 9c0ef115b..1270e0543 100644 --- a/asio/CMakeLists.txt +++ b/asio/CMakeLists.txt @@ -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}") diff --git a/ctest/CMakeLists.txt b/ctest/CMakeLists.txt index d56c9a16d..e80bc3f54 100644 --- a/ctest/CMakeLists.txt +++ b/ctest/CMakeLists.txt @@ -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 diff --git a/parameter/CMakeLists.txt b/parameter/CMakeLists.txt index 69f8df93f..78e70a671 100644 --- a/parameter/CMakeLists.txt +++ b/parameter/CMakeLists.txt @@ -127,7 +127,7 @@ 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 + # Unfortunately xmlSink and xmlSource need to be exposed to the plugins PUBLIC xmlserializer PRIVATE pfw_utility remote-processor PRIVATE ${CMAKE_DL_LIBS}) diff --git a/skeleton-subsystem/CMakeLists.txt b/skeleton-subsystem/CMakeLists.txt index 1ec822d05..adb376813 100644 --- a/skeleton-subsystem/CMakeLists.txt +++ b/skeleton-subsystem/CMakeLists.txt @@ -45,7 +45,7 @@ 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) From e1fcaef68bbeb435b869bf08e142d7cb5ff97f93 Mon Sep 17 00:00:00 2001 From: David Wagner Date: Tue, 22 Mar 2016 12:49:28 +0100 Subject: [PATCH 3/6] Regroup installed headers under a single directory On UNIX systems, headers used to be spread across 3 directories under the include dir, leading to, for instance, installing a "/usr/include/utility" directory... They are now all under a single subdir: /include/parameter. Signed-off-by: David Wagner --- skeleton-subsystem/CMakeLists.txt | 4 ++-- utility/CMakeLists.txt | 2 +- xmlserializer/CMakeLists.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/skeleton-subsystem/CMakeLists.txt b/skeleton-subsystem/CMakeLists.txt index adb376813..18e846555 100644 --- a/skeleton-subsystem/CMakeLists.txt +++ b/skeleton-subsystem/CMakeLists.txt @@ -58,8 +58,8 @@ find_library(PFW_CORE_LIBRARY NAMES parameter) set(PFW_INCLUDE_DIRS ${PFW_INCLUDE_ROOT}/parameter/plugin - ${PFW_INCLUDE_ROOT}/xmlserializer - ${PFW_INCLUDE_ROOT}/utility) + ${PFW_INCLUDE_ROOT}/parameter/xmlserializer + ${PFW_INCLUDE_ROOT}/parameter/utility) add_library(skeleton-subsystem MODULE SkeletonSubsystemBuilder.cpp diff --git a/utility/CMakeLists.txt b/utility/CMakeLists.txt index 49e01e29d..9c7d993ec 100644 --- a/utility/CMakeLists.txt +++ b/utility/CMakeLists.txt @@ -48,7 +48,7 @@ install(FILES ErrorContext.hpp Utility.h convert.hpp - DESTINATION "include/utility") + DESTINATION "include/parameter/utility") if(BUILD_TESTING) # Add unit test diff --git a/xmlserializer/CMakeLists.txt b/xmlserializer/CMakeLists.txt index 067a00e60..17cd81435 100644 --- a/xmlserializer/CMakeLists.txt +++ b/xmlserializer/CMakeLists.txt @@ -72,4 +72,4 @@ install(FILES XmlSource.h XmlElement.h XmlSerializingContext.h - DESTINATION "include/xmlserializer") + DESTINATION "include/parameter/xmlserializer") From 5799312b41e609772fd2790a6f9b838f4ab48266 Mon Sep 17 00:00:00 2001 From: David Wagner Date: Tue, 22 Mar 2016 13:33:13 +0100 Subject: [PATCH 4/6] CMake: automatically add the current src and bin dir the the include dirs We used to manually add them for almost all targets. Having CMake do it automatically simplifies the makefiles. Signed-off-by: David Wagner --- CMakeLists.txt | 4 ++++ bindings/c/CMakeLists.txt | 6 ------ parameter/CMakeLists.txt | 7 ++----- remote-processor/CMakeLists.txt | 6 ------ test/introspection-subsystem/CMakeLists.txt | 2 +- test/tmpfile/CMakeLists.txt | 1 - utility/CMakeLists.txt | 2 -- xmlserializer/CMakeLists.txt | 2 -- 8 files changed, 7 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8bf794113..9d94f2278 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/bindings/c/CMakeLists.txt b/bindings/c/CMakeLists.txt index 0c884122e..c04ac3c9c 100644 --- a/bindings/c/CMakeLists.txt +++ b/bindings/c/CMakeLists.txt @@ -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) diff --git a/parameter/CMakeLists.txt b/parameter/CMakeLists.txt index 78e70a671..185883950 100644 --- a/parameter/CMakeLists.txt +++ b/parameter/CMakeLists.txt @@ -133,11 +133,8 @@ target_link_libraries(parameter 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 include + PUBLIC log/include) install(TARGETS parameter LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib) # Client headers diff --git a/remote-processor/CMakeLists.txt b/remote-processor/CMakeLists.txt index ee21f55b6..95c348427 100644 --- a/remote-processor/CMakeLists.txt +++ b/remote-processor/CMakeLists.txt @@ -40,12 +40,6 @@ 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) diff --git a/test/introspection-subsystem/CMakeLists.txt b/test/introspection-subsystem/CMakeLists.txt index faccab348..1ec4bb5be 100644 --- a/test/introspection-subsystem/CMakeLists.txt +++ b/test/introspection-subsystem/CMakeLists.txt @@ -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) endif() diff --git a/test/tmpfile/CMakeLists.txt b/test/tmpfile/CMakeLists.txt index 84818e725..0dba1a16f 100644 --- a/test/tmpfile/CMakeLists.txt +++ b/test/tmpfile/CMakeLists.txt @@ -34,5 +34,4 @@ if(BUILD_TESTING) endif () add_library(tmpfile STATIC ${OS_SPECIFIC_TMPFILE}) - target_include_directories(tmpfile PUBLIC .) endif() diff --git a/utility/CMakeLists.txt b/utility/CMakeLists.txt index 9c7d993ec..8173ecaa3 100644 --- a/utility/CMakeLists.txt +++ b/utility/CMakeLists.txt @@ -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) diff --git a/xmlserializer/CMakeLists.txt b/xmlserializer/CMakeLists.txt index 17cd81435..41e4004fb 100644 --- a/xmlserializer/CMakeLists.txt +++ b/xmlserializer/CMakeLists.txt @@ -60,8 +60,6 @@ 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) From 19f7443ada7ac1ed88c47ef77bc0b4dd63c04c37 Mon Sep 17 00:00:00 2001 From: David Wagner Date: Wed, 23 Mar 2016 16:58:22 +0100 Subject: [PATCH 5/6] functional tests/CMake: add a missing library link The functional tests rely on at least one libpfw_utility-provided feature: the BinaryCopy class. Therefore, it must explicitly link against it. Signed-off-by: David Wagner --- test/functional-tests/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/functional-tests/CMakeLists.txt b/test/functional-tests/CMakeLists.txt index 1ab0449c8..fdc0f6906 100644 --- a/test/functional-tests/CMakeLists.txt +++ b/test/functional-tests/CMakeLists.txt @@ -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) From eaecc74e5d0a0c44f263095312a62f84f9b154c3 Mon Sep 17 00:00:00 2001 From: David Wagner Date: Mon, 21 Mar 2016 19:03:01 +0100 Subject: [PATCH 6/6] CMake: Generate a package configuration file A Package Configuration file lets other CMake projects easily use our own installed project, simply by calling find_package(ParameterFramework). Also, Instead of linking against ParameterFramework::parameter, plugins may now link against ParameterFramework::plugin. This has the added value of preventing the installation of libxmlserializer.a and libpfw_utility.a. The related CMake documentation can be found at https://cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html#package-configuration-file Signed-off-by: David Wagner --- CMakeLists.txt | 1 + appveyor.yml | 2 +- cmake/CMakeLists.txt | 50 +++++++++++++++++++++ cmake/ParameterFrameworkConfig.cmake | 29 ++++++++++++ parameter/CMakeLists.txt | 28 +++++++++--- remote-processor/CMakeLists.txt | 3 +- skeleton-subsystem/CMakeLists.txt | 17 ++----- skeleton-subsystem/test/CMakeLists.txt | 3 +- test/introspection-subsystem/CMakeLists.txt | 2 +- test/test-subsystem/CMakeLists.txt | 2 +- xmlserializer/CMakeLists.txt | 1 - 11 files changed, 111 insertions(+), 27 deletions(-) create mode 100644 cmake/CMakeLists.txt create mode 100644 cmake/ParameterFrameworkConfig.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d94f2278..817421865 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,3 +130,4 @@ add_subdirectory(doc) add_subdirectory(schemas) add_subdirectory(cpack) +add_subdirectory(cmake) diff --git a/appveyor.yml b/appveyor.yml index f1e38dc56..cd2f0dfac 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt new file mode 100644 index 000000000..29ce10a3c --- /dev/null +++ b/cmake/CMakeLists.txt @@ -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) diff --git a/cmake/ParameterFrameworkConfig.cmake b/cmake/ParameterFrameworkConfig.cmake new file mode 100644 index 000000000..cc14d4684 --- /dev/null +++ b/cmake/ParameterFrameworkConfig.cmake @@ -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") diff --git a/parameter/CMakeLists.txt b/parameter/CMakeLists.txt index 185883950..05c90af13 100644 --- a/parameter/CMakeLists.txt +++ b/parameter/CMakeLists.txt @@ -127,16 +127,32 @@ endif() configure_file(version.h.in "${CMAKE_CURRENT_BINARY_DIR}/version.h") target_link_libraries(parameter - # Unfortunately 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 - PUBLIC log/include) + PUBLIC $ + PUBLIC $) + +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" diff --git a/remote-processor/CMakeLists.txt b/remote-processor/CMakeLists.txt index 95c348427..5887bf5ea 100644 --- a/remote-processor/CMakeLists.txt +++ b/remote-processor/CMakeLists.txt @@ -42,4 +42,5 @@ find_package(Threads REQUIRED) 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) diff --git a/skeleton-subsystem/CMakeLists.txt b/skeleton-subsystem/CMakeLists.txt index 18e846555..1bc1d874c 100644 --- a/skeleton-subsystem/CMakeLists.txt +++ b/skeleton-subsystem/CMakeLists.txt @@ -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 @@ -49,25 +51,12 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN true) 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}/parameter/xmlserializer - ${PFW_INCLUDE_ROOT}/parameter/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 diff --git a/skeleton-subsystem/test/CMakeLists.txt b/skeleton-subsystem/test/CMakeLists.txt index 46cb66911..d36d456b1 100644 --- a/skeleton-subsystem/test/CMakeLists.txt +++ b/skeleton-subsystem/test/CMakeLists.txt @@ -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}" diff --git a/test/introspection-subsystem/CMakeLists.txt b/test/introspection-subsystem/CMakeLists.txt index 1ec4bb5be..b59be40f5 100644 --- a/test/introspection-subsystem/CMakeLists.txt +++ b/test/introspection-subsystem/CMakeLists.txt @@ -54,5 +54,5 @@ if (BUILD_TESTING) target_include_directories(introspection-subsystem PUBLIC "include") - target_link_libraries(introspection-subsystem PRIVATE parameter) + target_link_libraries(introspection-subsystem PRIVATE plugin-internal-hack) endif() diff --git a/test/test-subsystem/CMakeLists.txt b/test/test-subsystem/CMakeLists.txt index eeaa7de45..e5e752bde 100644 --- a/test/test-subsystem/CMakeLists.txt +++ b/test/test-subsystem/CMakeLists.txt @@ -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() diff --git a/xmlserializer/CMakeLists.txt b/xmlserializer/CMakeLists.txt index 41e4004fb..91f51d2fe 100644 --- a/xmlserializer/CMakeLists.txt +++ b/xmlserializer/CMakeLists.txt @@ -64,7 +64,6 @@ target_link_libraries(xmlserializer PUBLIC pfw_utility # For NonCopyable and ErrorContext PRIVATE LibXml2::libxml2) - install(FILES XmlSink.h XmlSource.h