From dcccf2d0c8d52a3d9755549288a255edc652e07d Mon Sep 17 00:00:00 2001 From: Thomas Ingleby Date: Sat, 21 Mar 2015 13:15:14 +0000 Subject: [PATCH] adafruitms1438: Link against CMake target Instead of trying to call out the build environment for a .so to link against, use the one UPM will build as a dependency. Also add guards around the SWIG commands for both Node and Python targets Signed-off-by: Thomas Ingleby Signed-off-by: Mihai Tudor Panu --- src/adafruitms1438/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/adafruitms1438/CMakeLists.txt b/src/adafruitms1438/CMakeLists.txt index 66db9400..52b7f726 100644 --- a/src/adafruitms1438/CMakeLists.txt +++ b/src/adafruitms1438/CMakeLists.txt @@ -5,6 +5,11 @@ set (module_h ${libname}.h) set (reqlibname "upm-pca9685") include_directories("../pca9685") upm_module_init() +add_dependencies(${libname} pca9685) target_link_libraries(${libname} pca9685) -swig_link_libraries (jsupm_${libname} -lupm-pca9685 ${MRAA_LIBRARIES} ${NODE_LIBRARIES}) -swig_link_libraries (pyupm_${libname} -lupm-pca9685 ${PYTHON_LIBRARIES} ${MRAA_LIBRARIES}) +if (BUILDSWIGNODE) + swig_link_libraries (jsupm_${libname} pca9685 ${MRAA_LIBRARIES} ${NODE_LIBRARIES}) +endif() +if (BUILDSWIGPYTHON) + swig_link_libraries (pyupm_${libname} pca9685 ${PYTHON_LIBRARIES} ${MRAA_LIBRARIES}) +endif()