mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
cmake: Use include/lib paths from MRAA pkgconfig for cmake
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
669fd317b6
commit
d0504bb65b
@ -5,12 +5,10 @@ UPM uses cmake in order to make compilation relatively painless. Cmake runs
|
||||
build out of tree so the recommended way is to clone from git and make a build/
|
||||
directory.
|
||||
|
||||
This project depends on libmraa, so that needs to be installed first. Use the
|
||||
following environment variables to configure the paths:
|
||||
This project depends on libmraa, so that needs to be installed first. Append
|
||||
the install location of mraa pkgconfig to the following environment variable:
|
||||
|
||||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:.../mraa/build/lib/pkgconfig
|
||||
CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:.../mraa/build/include
|
||||
LIBRARY_PATH=$LIBRARY_PATH:.../mraa/build/lib
|
||||
|
||||
UPM will attempt to build all directories inside src/ and they must contain
|
||||
individual CMakeLists.txt files.
|
||||
|
@ -74,6 +74,10 @@ endmacro()
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/examples)
|
||||
|
||||
# Set the mraa include and link directories prior to adding examples
|
||||
include_directories (${MRAA_INCLUDE_DIRS})
|
||||
link_directories (${MRAA_LIBDIR})
|
||||
|
||||
# If your sample source file matches the name of the module it tests, add it here
|
||||
# Exceptions are as follows:
|
||||
# string after first '-' is ignored (e.g. nrf24l01-transmitter maps to nrf24l01)
|
||||
|
@ -172,11 +172,12 @@ if (SWIG_FOUND)
|
||||
endif()
|
||||
|
||||
macro(upm_module_init)
|
||||
link_directories (${MRAA_LIBDIR})
|
||||
add_library (${libname} SHARED ${module_src})
|
||||
foreach (linkflag ${ARGN})
|
||||
target_link_libraries (${libname} ${linkflag})
|
||||
endforeach ()
|
||||
include_directories (${MRAA_INCLUDE_DIR} .)
|
||||
include_directories (${MRAA_INCLUDE_DIRS} .)
|
||||
target_link_libraries (${libname} ${MRAA_LIBRARIES})
|
||||
set_target_properties(
|
||||
${libname}
|
||||
|
Loading…
x
Reference in New Issue
Block a user