Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

compile your i2c library similar to

add_library(mylib src/mylib.cpp)

then compile your node then link your library to your node

add_executable(mynode src/mynode.cpp)
target_link_libraries(mynode mylib)

hope this helps

compile your i2c library similar to

add_library(mylib src/mylib.cpp)

then compile your node then link your library to your node

add_executable(mynode src/mynode.cpp)
target_link_libraries(mynode mylib)

If it is an external library

find_package( PkgConfig REQUIRED) pkg_check_modules( mylib REQUIRED ulapi )

then link the library to your node

hope this helps

compile your i2c library similar to

add_library(mylib src/mylib.cpp)

then compile your node then link your library to your node

add_executable(mynode src/mynode.cpp)
target_link_libraries(mynode mylib)

If it is an external library

find_package( PkgConfig REQUIRED)
pkg_check_modules( mylib REQUIRED ulapi )

)

then link the library to your node

add_executable(mynode src/mynode.cpp)
target_link_libraries( my_exec ${ulapi_LIBRARIES} )

hope this helps

compile your i2c library similar to

add_library(mylib src/mylib.cpp)

then compile your node then link your library to your node

add_executable(mynode src/mynode.cpp)
target_link_libraries(mynode mylib)

If it is an external library

find_package( PkgConfig REQUIRED)
pkg_check_modules( mylib REQUIRED ulapi mylib )

then link the library to your node

add_executable(mynode src/mynode.cpp)
target_link_libraries( my_exec ${ulapi_LIBRARIES} )
target_link_libraries(mynode ${mylib_LIBRARIES})

hope this helps

compile your i2c library similar to

add_library(mylib src/mylib.cpp)

then compile your node then link your library to your node

add_executable(mynode src/mynode.cpp)
target_link_libraries(mynode mylib)

If it is an external library

find_package( PkgConfig REQUIRED)
pkg_check_modules( mylib REQUIRED mylib )

or

FIND_LIBRARY(mylib_LIBRARIES mylib /path/to/lib)

then link the library to your node

add_executable(mynode src/mynode.cpp)
target_link_libraries(mynode ${mylib_LIBRARIES})

hope this helps