Shared library for all AMRL C++ projects
- Install dependencies:
sudo apt-get install libgtest-dev libgoogle-glog-dev cmake build-essential
- Compile
make -j`nproc`
- In your own project, add this as a git submodule to a subdir (
src/shared
in this example):Alternatively, if using HTTPS:git submodule add [email protected]:umass-amrl/amrl_shared_lib.git src/shared
git submodule add https://github.com/ut-amrl/amrl_shared_lib.git src/shared
- In the main
CMakeLists.txt
for your project, add the directory as a cmake subdir, and add the subdir as a location to search for includes (the order of these commands matters):INCLUDE_DIRECTORIES(src/shared) ADD_SUBDIRECTORY(src/shared)
- Add
amrl_shared_lib
to the linker step for any executables (my-program
in this example) that use the shared library:TARGET_LINK_LIBRARIES(my-program amrl_shared_lib)
To change the name of the shared library, set AMRL_LIBRARY_NAME
prior to the INCLUDE_DIRECTORIES
call in Step 2, e.g.:
SET(AMRL_LIBRARY_NAME "alternate_link_name"
CACHE STRING "Name of compiled library")
To generate the unit tests for the shared library, set GENERATE_SHARED_LIB_UNITTESTS
to ON
prior to the INCLUDE_DIRECTORIES
call in Step 2, e.g.:
SET(GENERATE_SHARED_LIB_UNITTESTS ON)