Skip to content

Commit

Permalink
Added non-GLFW CMakeLists.txt file and extended README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fairlight1337 committed Oct 8, 2015
1 parent 68df2b7 commit a5cd453
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 11 deletions.
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,15 @@ endif()

### Install ###

install(DIRECTORY include/cflie
install(
DIRECTORY include/cflie
DESTINATION include
FILES_MATCHING
PATTERN "*.h"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)

install(
TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
COMPONENT library
)
COMPONENT library)
61 changes: 61 additions & 0 deletions CMakeLists_noGUI.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
cmake_minimum_required(VERSION 2.6)
project(cflie)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

set(${PROJECT_NAME}_VERSION_MAJOR_0)
set(${PROJECT_NAME}_VERSION_MINOR_1)

include_directories("${PROJECT_SOURCE_DIR}/include")

find_library(USB_LIB usb-1.0)
if(${USB_LIB} STREQUAL "USB_LIB-NOTFOUND")
message(STATUS "The USB libs appear to not be installed.")
message(FATAL_ERROR "On Ubuntu, do: sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev")
endif()


### Libraries ###

add_library(${PROJECT_NAME}
src/cflie/CCrazyRadio.cpp
src/cflie/CCrazyflie.cpp
src/cflie/CCRTPPacket.cpp
src/cflie/CTOC.cpp)


### Executables ###

add_executable(ex-replugging src/examples/replugging.cpp)
add_executable(ex-simple src/examples/simple.cpp)


### Linking ###

target_link_libraries(${PROJECT_NAME} ${USB_LIB})
target_link_libraries(ex-replugging ${PROJECT_NAME})
target_link_libraries(ex-simple ${PROJECT_NAME})

# ARM needs librt linked in
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm")
target_link_libraries(${PROJECT_NAME} rt)
target_link_libraries(ex-replugging rt)
target_link_libraries(ex-simple rt)
target_link_libraries(ex-gui rt)
endif()


### Install ###

install(DIRECTORY include/cflie
DESTINATION include
FILES_MATCHING
PATTERN "*.h"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)

install(
TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
COMPONENT library)
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ now, these are:

| **Distribution** | **Version** | **Name** | **Architecture** |
|------------------|-------------|----------------------|------------------|
| Ubuntu | 12.04 | Precise Pangolin | i386 |
| Ubuntu | 14.04 | Trusty Tahr | i386 |
| Ubuntu | 14.10 | Utopic Unicorn | i386 |
| Ubuntu | 15.04 | Vivid Veret | amd64 |
| Ubuntu | 15.10 | Wily Werewolf | amd64 |
| Ubuntu Linux | 12.04 | Precise Pangolin | i386 |
| Ubuntu Linux | 14.04 | Trusty Tahr | i386 |
| Ubuntu Linux | 14.10 | Utopic Unicorn | i386 |
| Ubuntu Linux | 15.04 | Vivid Veret | amd64 |
| Ubuntu Linux | 15.10 | Wily Werewolf | amd64 |

So, the current state of the library might or might not run on your
system if you differ from those. I'll be more than happy to
Expand All @@ -60,10 +60,11 @@ it running on some architecture not listed here, let me know!
Dependencies
------------

The lib depends on GLFW, which you can install under Ubuntu by `apt-get install`'ing this:
One of the examples included with the library depends on GLFW, which you can install under Ubuntu by `apt-get install`'ing this:
```
$ sudo apt-get install libglfw-dev libglfw2 cmake
```
If you do not wish to depend on GLFW, use the file `CMakeLists_noGUI.txt` instead of `CMakeLists.txt`. The example `ex-gui` will not be built, then.


How to install from binaries
Expand Down Expand Up @@ -155,3 +156,17 @@ $ sudo ./../bin/ex-gui
```

Again, exit the example by pressing `ESC`.


Important Notice (concerning development and support)
-----------------------------------------------------

After developing the core parts of the library and maintaining it for
a while, supporting users and co-developers in several projects, I
decided to stop actively developing the library further. This is
solely due to other time-consuming things in my life, so I won't be
able to help you getting your project to run. By now there are lots of
forks of the library and example programs using it (try Google'ing it
or look at the GitHub forks). I still incorporate pull requests and
bug fixes and look after keeping the build farms happy with the source
(Travis CI, Launchpad), but can't help your individual projects.

0 comments on commit a5cd453

Please sign in to comment.