Skip to content

Commit

Permalink
updates to readme adn cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Dexter Watkins committed Mar 29, 2018
1 parent ddb67f2 commit a6d44f5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ cd
mkdir catkin_ws #if a workspace does not already exist
cd catkin_ws
git clone https://github.com/rosmod/lib-can.git src/lib-can
catkin build can
catkin build lib-can
```

Update Library:
-----------------

```bash
cd ~/catkin_ws
catkin clean can
catkin clean lib-can
cd src/lib-can
git pull
cd ..
catkin build can
catkin build lib-can
```


Expand Down
21 changes: 17 additions & 4 deletions src/lib-can/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
cmake_minimum_required(VERSION 2.8.3)
project(lib-can)

find_package(catkin REQUIRED COMPONENTS)

catkin_package(
INCLUDE_DIRS include
)

## Start Global Marker

## End Global Marker
Expand All @@ -10,13 +16,20 @@ include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_CXX_FLAGS "-std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "-std=c++0x")
set(CMAKE_CXX_FLAGS "-std=c++0x")
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()

include_directories(include)
add_library(lib-can
src/lib-can/lib-can.c)
src/lib-can/lib-can.c)

install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} FILES_MATCHING PATTERN "*.h" )
install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} FILES_MATCHING PATTERN "*.hpp" )

install(TARGETS lib-can
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})

0 comments on commit a6d44f5

Please sign in to comment.