Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pkgconfig #1889

Merged
merged 3 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ configure_file(MAVSDKConfig.cmake.in
configure_file(MAVSDKConfig.cmake.in
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/MAVSDKConfig.cmake" @ONLY)

# Pkg-config
configure_file(mavsdk.pc.in
"${PROJECT_BINARY_DIR}/mavsdk.pc" @ONLY)

include(CMakePackageConfigHelpers)
# Supply version to config
write_basic_package_version_file(
Expand All @@ -110,3 +114,7 @@ install(FILES
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/MAVSDKConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/MAVSDKConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MAVSDK)

install(FILES
"${PROJECT_BINARY_DIR}/mavsdk.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
11 changes: 11 additions & 0 deletions src/mavsdk.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_FULL_BINDIR@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@

Name: MAVSDK
Description: API and library for MAVLink compatible systems written in C++17
Version: @MAVSDK_VERSION_STRING@
Requires.private: libcurl jsoncpp tinyxml2
julianoes marked this conversation as resolved.
Show resolved Hide resolved
Libs: -L"${libdir}" -lmavsdk
Cflags: -I"${includedir}" -I"${includedir}/mavsdk"