diff options
author | Adrien M <adrienx.martin@intel.com> | 2015-03-20 19:03:32 +0100 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-04-24 13:39:12 -0700 |
commit | 5aaddd16f2aabccf07687f1761567eb6455abe61 (patch) | |
tree | 62a4adda1e9f000614247e06f88db3359e637961 /bindings | |
parent | 19aa05b33990302d2388b8c90eeb71a3509e6320 (diff) | |
download | external_parameter-framework-5aaddd16f2aabccf07687f1761567eb6455abe61.zip external_parameter-framework-5aaddd16f2aabccf07687f1761567eb6455abe61.tar.gz external_parameter-framework-5aaddd16f2aabccf07687f1761567eb6455abe61.tar.bz2 |
Dissociate 'make test' & 'make install'
Possibility to run the test without having to lunch the 'make install'
command.
Signed-off-by: Adrien M <adrienx.martin@intel.com>
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/c/CMakeLists.txt | 6 | ||||
-rw-r--r-- | bindings/python/CMakeLists.txt | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/bindings/c/CMakeLists.txt b/bindings/c/CMakeLists.txt index b83ef6f..36b6aa9 100644 --- a/bindings/c/CMakeLists.txt +++ b/bindings/c/CMakeLists.txt @@ -58,5 +58,9 @@ if(BUILD_TESTING) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nonnull") target_link_libraries(cparameterUnitTest cparameter) - add_test(cparameterUnitTest cparameterUnitTest) + add_test(NAME cparameterUnitTest + COMMAND cparameterUnitTest) + + # Custom function defined in the top-level CMakeLists + set_test_env(cparameterUnitTest) endif() diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt index 907741d..f3fc388 100644 --- a/bindings/python/CMakeLists.txt +++ b/bindings/python/CMakeLists.txt @@ -39,7 +39,16 @@ set_property(SOURCE pfw.i PROPERTY SWIG_FLAGS "-Wall" "-Werror") swig_add_module(PyPfw python pfw.i) swig_link_libraries(PyPfw parameter ${PYTHON_LIBRARIES}) - +# For convenience, the global library output directory +# (CMAKE_LIBRARY_OUTPUT_DIRECTORY) is set to ${CMAKE_BINARY_DIR}/lib, so that +# all libs are generated in the same folder. This help writing test targets +# (add_test) that do not need "make install" to be run. +# However, putting _PyPfw.so in that folder defeats the purpose described +# above because when running tests using the python bindings, the PYTHONPATH +# needs to contain both _PyPfw.so and PyPfw.py. Without the line below, +# _PyPfw.so would be put in ${CMAKE_BINARY_DIR}/lib while PyPfw.py is put in +# ${CMAKE_CURRENT_BINARY_DIR}. +set_property(TARGET _PyPfw PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # The 'unused-but-set-variable' warning must be disabled because SWIG generates # files that do not respect that contraint. |