Skip to content

Commit

Permalink
Added regilo-lib package.
Browse files Browse the repository at this point in the history
  • Loading branch information
branoholy committed Feb 10, 2016
1 parent f216414 commit be8591b
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 38 deletions.
49 changes: 28 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 2.8)

# For compatibility with PROJECT_VERSION*
# For compatibility with PROJECT_VERSION* variables
if((${CMAKE_VERSION} VERSION_GREATER "3.0") OR (${CMAKE_VERSION} VERSION_EQUAL "3.0"))
cmake_policy(SET CMP0048 OLD)
endif()
Expand All @@ -11,7 +11,7 @@ project("regilo")
# Set project version
set(PROJECT_VERSION_MAJOR "2")
set(PROJECT_VERSION_MINOR "1")
set(PROJECT_VERSION_PATCH "1")
set(PROJECT_VERSION_PATCH "2")
set(PROJECT_VERSION_TWEAK "")
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")

Expand All @@ -28,6 +28,8 @@ option(example "Build the console example")
option(example-gui "Build the GUI example")
option(examples "Build all examples")
option(examples-only "Build only examples (not the library)")
option(headers-only "Install the headers only (no library)")
option(library-only "Install the library only (no headers)")
option(INSTALL_LIB_DIR "Installation directory for libraries")

# Set build type and definitions
Expand All @@ -50,32 +52,37 @@ find_package(Boost 1.54 COMPONENTS system REQUIRED)
include_directories(${Boost_INCLUDE_DIR})

if(${examples-only} STREQUAL "OFF")
# Find source code
file(GLOB_RECURSE CPPS "src/regilo/*.cpp")
file(GLOB_RECURSE HPPS "include/regilo/*.hpp")

# Include headers
include_directories("include")

# Configure files
configure_file("src/regilo/version.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/gen/regilo/version.cpp")
list(APPEND CPPS "${CMAKE_CURRENT_BINARY_DIR}/gen/regilo/version.cpp")
if(${headers-only} STREQUAL "OFF")
# Find source code
file(GLOB_RECURSE CPPS "src/regilo/*.cpp")
file(GLOB_RECURSE HPPS "include/regilo/*.hpp")

# Create library
add_library(${PROJECT_NAME} SHARED ${CPPS} ${HPPS})
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
# Configure files
configure_file("src/regilo/version.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/gen/regilo/version.cpp")
list(APPEND CPPS "${CMAKE_CURRENT_BINARY_DIR}/gen/regilo/version.cpp")

# Install library
if(${INSTALL_LIB_DIR} STREQUAL "OFF")
set(INSTALL_LIB_DIR "lib")
endif()
# Create library
add_library(${PROJECT_NAME} SHARED ${CPPS} ${HPPS})
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")

# Install library
if(${INSTALL_LIB_DIR} STREQUAL "OFF")
set(INSTALL_LIB_DIR "lib")
endif()

install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${INSTALL_LIB_DIR})
install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION include/${PROJECT_NAME})
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${INSTALL_LIB_DIR})

# Link libraries
target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
# Link libraries
target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
endif()

if(${library-only} STREQUAL "OFF")
install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION include/${PROJECT_NAME})
endif()
endif()

# Add examples
Expand Down
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,21 @@ To uninstall:
```

### Packages
There are two packages you can install. The first one is the `regilo` library
with the `regilo-scan` example in packages:

* `regilo` in Arch Linux,
* `libregilo-dev` in Debian and Ubuntu,
* `regilo-devel` in Fedora.

The second one is the `regilo-visual` example in the `regilo-visual` package in
all supported operating systems.
There are three packages you can install. The package names adhere to the
conventions of the operating systems.

| Operating system | Package name | Package content |
| ---------------- | --------------- | ------------------------------- |
| Arch Linux | `regilo-lib` | only runtime library |
| | `regilo` | library, headers, `regilo-scan` |
| Debian / Ubuntu | `libregilo` | only runtime library |
| | `libregilo-dev` | library, headers, `regilo-scan` |
| Fedora | `regilo` | only runtime library |
| | `regilo-devel` | library, headers, `regilo-scan` |
| All | `regilo-visual` | library, `regilo-visual` |

#### Arch Linux
You can install `regilo` and `regilo-visual` in Arch Linux from the
You can install `regilo`, `regilo-lib`, and `regilo-visual` in Arch Linux from the
[AUR](https://aur.archlinux.org/packages/?K=regilo).

Do not forget to add
Expand All @@ -122,7 +125,7 @@ $ gpg --recv-key D25809BF3563AA56A12B0F4D545EDD46FBAC61E6

#### Ubuntu
In Ubuntu, you can use my [ppa:branoholy/regilo](https://launchpad.net/~branoholy/+archive/ubuntu/regilo)
and install the `libregilo-dev` and `regilo-visual` packages.
and install the `libregilo`, `libregilo-dev`, and `regilo-visual` packages.

```text
$ sudo add-apt-repository ppa:branoholy/regilo
Expand All @@ -133,7 +136,7 @@ $ sudo apt-get install libregilo-dev
#### Debian
[openSUSE Build Service](https://build.opensuse.org/package/show/home:branoholy/regilo)
can be used in Debian 8. You need to add my key and repository, and then install
the `libregilo-dev` and `regilo-visual` packages.
the `libregilo`, `libregilo-dev`, and `regilo-visual` packages.

```text
$ wget http://download.opensuse.org/repositories/home:/branoholy/Debian_8.0/Release.key -O - | sudo apt-key add -
Expand All @@ -145,7 +148,7 @@ $ sudo apt-get install libregilo-dev
#### Fedora
[openSUSE Build Service](https://build.opensuse.org/package/show/home:branoholy/regilo)
can be used in Fedora 22 and 23 as well. You need to add my repository and then
install the `regilo-devel` and `regilo-visual` packages.
install the `regilo`, `regilo-devel`, and `regilo-visual` packages.

##### Fedora 22

Expand Down Expand Up @@ -174,6 +177,5 @@ output. Same scanning functionality can be done with the Hokuyo as well.

## License
Regilo is licensed under GNU GPL v3 (see
[LICENSE](https://github.com/branoholy/regilo/blob/master/LICENSE)
file).
[LICENSE](https://github.com/branoholy/regilo/blob/master/LICENSE) file).

2 changes: 1 addition & 1 deletion examples/regilo-scan/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void printHelp()
<< " (path or ip and port, default: \"10.0.0.1:12345\")." << std::endl
<< " -h Show this help." << std::endl
<< std::endl
<< "Using libregilo " << regilo::Version::VERSION << std::endl;
<< "Using regilo-" << regilo::Version::VERSION << std::endl;
}

int main(int argc, char** argv)
Expand Down
2 changes: 1 addition & 1 deletion examples/regilo-visual/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void printHelp()
<< " -a Turn on automatic scanning before move." << std::endl
<< " -h Show this help." << std::endl
<< std::endl
<< "Using libregilo " << regilo::Version::VERSION << std::endl;
<< "Using regilo-" << regilo::Version::VERSION << std::endl;
}

int main(int argc, char** argv)
Expand Down

0 comments on commit be8591b

Please sign in to comment.