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

Commit d55a88f

Browse files
authored
Merge pull request #392 from dawagner/no-client-simulator-subproject
cmake: Make client simulator a subdir instead of a subproject
2 parents 1e18709 + b68635e commit d55a88f

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

.travis.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
global:
1515
- PREFIX=$HOME/prefix
1616
- MY_CMAKE_OPTIONS="-DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_INSTALL_PREFIX=$HOME/install"
17+
- OSX_CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DPYTHON_BINDINGS=OFF -DCLIENT_SIMULATOR=OFF"
1718
- CTEST_OUTPUT_ON_FAILURE=1
1819
- LINUX=false
1920
- OSX=false
@@ -89,7 +90,7 @@ before_script:
8990
coverage=ON;
9091
export CCACHE_CPP2=1;
9192
fi
92-
- if $OSX; then export MY_CMAKE_OPTIONS+=" -DBUILD_TESTING=OFF -DPYTHON_BINDINGS=OFF"; fi
93+
- if $OSX; then export MY_CMAKE_OPTIONS+=" $OSX_CMAKE_OPTIONS"; fi
9394

9495
# how to build
9596
script:
@@ -112,12 +113,6 @@ script:
112113
make -j$(nproc) &&
113114
(if $LINUX; then make ExperimentalTest ExperimentalMemCheck; fi) &&
114115
make install )
115-
- if $LINUX; then ( cd tools/clientSimulator &&
116-
echo "TODO - install the generated .deb instead of using \$HOME/install."
117-
"This would permit to test the packaging" &&
118-
cmake $MY_CMAKE_OPTIONS . &&
119-
make &&
120-
make install ); fi
121116
# Check that all installed files are in a component (no "unspecified
122117
# component" archive created)
123118
- (cd build && cpack -G TGZ -D CPACK_ARCHIVE_COMPONENT_INSTALL=ON &&
@@ -126,7 +121,7 @@ script:
126121
- ( mkdir build_less_features && cd build_less_features &&
127122
rm -rf $PREFIX/asio-1.10.6 &&
128123
cmake $MY_CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Debug
129-
-DNETWORKING=OFF -DPYTHON_BINDINGS=OFF -DC_BINDINGS=OFF .. &&
124+
-DNETWORKING=OFF -DPYTHON_BINDINGS=OFF -DC_BINDINGS=OFF -DCLIENT_SIMULATOR=OFF .. &&
130125
make -j$(nproc) &&
131126
(if $LINUX; then make test; fi) )
132127

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ option(PYTHON_BINDINGS "Python library to use the Parameter Framework from pytho
5050
option(C_BINDINGS "Library to use the Parameter Framework using a C API" ON)
5151
option(FATAL_WARNINGS "Turn warnings into errors (-Werror flag)" ON)
5252
option(NETWORKING "Set to OFF in order to stub networking code" ON)
53+
option(CLIENT_SIMULATOR "Set to OFF to disable client simulator" ON)
5354

5455
include(SetVersion.cmake)
5556

@@ -126,6 +127,9 @@ endif()
126127

127128
add_subdirectory(tools/xmlGenerator)
128129
add_subdirectory(tools/xmlValidator)
130+
if (CLIENT_SIMULATOR)
131+
add_subdirectory(tools/clientSimulator)
132+
endif()
129133

130134
add_subdirectory(bindings)
131135

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ build_script:
7070
- mkdir 64bits-debug && cd 64bits-debug
7171
# Add debug libxml2.dll in the path so that tests can find it
7272
- set TEST_PATH=%DEBUG_LIBXML2_PATH%\bin
73-
- cmake -G "NMake Makefiles" -DPYTHON_BINDINGS=OFF -DCMAKE_PREFIX_PATH="%PREFIX_PATH%;%DEBUG_LIBXML2_PATH%" ..\..
73+
- cmake -G "NMake Makefiles" -DPYTHON_BINDINGS=OFF -DCLIENT_SIMULATOR=OFF -DCMAKE_PREFIX_PATH="%PREFIX_PATH%;%DEBUG_LIBXML2_PATH%" ..\..
7474
- cmake --build . --config debug
7575
- ctest --build-config debug %CTEST_PARAMS%
7676
- cd ..
7777

7878
- mkdir 64bits-release & cd 64bits-release
7979
# Add debug libxml2.dll in the path so that tests can find it
8080
- set TEST_PATH=%RELEASE_LIBXML2_PATH%\bin
81-
- cmake -G "Visual Studio 14 2015 Win64" -DPYTHON_BINDINGS=OFF -DCMAKE_PREFIX_PATH="%PREFIX_PATH%;%RELEASE_LIBXML2_PATH%" -DCMAKE_INSTALL_PREFIX=%INSTALL% ..\..
81+
- cmake -G "Visual Studio 14 2015 Win64" -DPYTHON_BINDINGS=OFF -DCLIENT_SIMULATOR=OFF -DCMAKE_PREFIX_PATH="%PREFIX_PATH%;%RELEASE_LIBXML2_PATH%" -DCMAKE_INSTALL_PREFIX=%INSTALL% ..\..
8282
# Build, test and install
8383
- cmake --build . --config release
8484
- ctest --build-config release %CTEST_PARAMS%

tools/clientSimulator/CMakeLists.txt

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2015, Intel Corporation
1+
# Copyright (c) 2015-2017, Intel Corporation
22
# All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without modification,
@@ -26,27 +26,25 @@
2626
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2727
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

29-
# has been tested on 2.8.11 only - should not work on older versions
30-
cmake_minimum_required(VERSION 2.8.11)
31-
32-
project(parameter-framework-clientSimulator)
33-
34-
# Force usage of Python 3.x ...
35-
find_package(PythonInterp 3 REQUIRED)
36-
# ... and force the libs to be at the same version as the interpreter
37-
find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT REQUIRED)
38-
include_directories(${PYTHON_INCLUDE_DIRS})
29+
# Force usage of Python 3.x; here, we use find_program instead of find_package
30+
# because other parts of Parameter Framework request Python 2.x and CMake has
31+
# troubles with the cohabitation.
32+
find_program(PYTHON3 python3 REQUIRED)
3933

4034
# Find the python modules install path.
4135
# plat_specific is needed because we are installing a shared-library python
4236
# module and not only a pure python module.
4337
# prefix='' makes get_python_lib return a relative path.
4438
execute_process(COMMAND
45-
${PYTHON_EXECUTABLE} -c
39+
${PYTHON3} -c
4640
"from distutils import sysconfig;\\
4741
print(sysconfig.get_python_lib(plat_specific=True, prefix=''))"
4842
OUTPUT_VARIABLE PYTHON_MODULE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
4943

50-
install(DIRECTORY clientsimulator DESTINATION ${PYTHON_MODULE_PATH})
44+
install(DIRECTORY clientsimulator
45+
DESTINATION ${PYTHON_MODULE_PATH}
46+
COMPONENT client_simulator)
5147

52-
install(PROGRAMS pfClientSimulator.py DESTINATION bin)
48+
install(PROGRAMS pfClientSimulator.py
49+
DESTINATION bin
50+
COMPONENT client_simulator)

0 commit comments

Comments
 (0)