1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-09-21 03:39:48 +00:00

Add install and uninstall targets to nav_msg_listener

This commit is contained in:
Carles Fernandez 2024-09-16 18:13:12 +02:00
parent c61d69b627
commit d40e3427d4
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
4 changed files with 64 additions and 0 deletions

View File

@ -85,6 +85,7 @@ All notable changes to GNSS-SDR will be documented in this file.
### Improvements in Usability: ### Improvements in Usability:
- Tidy up the `conf/` folder. - Tidy up the `conf/` folder.
- Add `install` and `uninstall` targets to the `nav_msg_listener` utility.
See the definitions of concepts and metrics at See the definitions of concepts and metrics at
https://gnss-sdr.org/design-forces/ https://gnss-sdr.org/design-forces/

View File

@ -39,3 +39,19 @@ target_include_directories(navmsg_lib
add_executable(nav_msg_listener ${NAVLISTENER_SOURCE_DIR}/main.cc) add_executable(nav_msg_listener ${NAVLISTENER_SOURCE_DIR}/main.cc)
target_link_libraries(nav_msg_listener PUBLIC navmsg_lib) target_link_libraries(nav_msg_listener PUBLIC navmsg_lib)
install(TARGETS nav_msg_listener
RUNTIME DESTINATION bin
COMPONENT "nav_msg_listener"
)
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY
)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
)
endif()

View File

@ -27,6 +27,18 @@ $ cmake ..
$ make $ make
``` ```
Optionally, you can install it:
```
$ sudo make install
```
and uninstall it later with:
```
$ sudo make uninstall
```
## Usage ## Usage
In order to tell GNSS-SDR to generate those messages, you need to include the In order to tell GNSS-SDR to generate those messages, you need to include the

View File

@ -0,0 +1,35 @@
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
# This file is part of GNSS-SDR.
#
# SPDX-FileCopyrightText: 2011-2020 C. Fernandez-Prades cfernandez(at)cttc.es
# SPDX-License-Identifier: BSD-3-Clause
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
endif()
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
if(CMAKE_VERSION VERSION_LESS 3.17)
execute_process(
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval
)
else()
execute_process(
COMMAND @CMAKE_COMMAND@ -E rm "$ENV{DESTDIR}${file}"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval
)
endif()
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
endif()
else()
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
endif()
endforeach()