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 <thomas.c.ingleby@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Thomas Ingleby 2015-03-21 13:15:14 +00:00 committed by Mihai Tudor Panu
parent ae83074f6f
commit dcccf2d0c8

View File

@ -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()