Skip to content
Open
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
13 changes: 13 additions & 0 deletions fastdds.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
prefix=@CMAKE_INSTALL_PREFIX@
includedir=@includedir_for_pc_file@
libdir=@libdir_for_pc_file@

Name: fastdds
Description: C++ implementation of the DDS (Data Distribution Service) standard
URL: https://github.com/eProsima/Fast-DDS
Version: @PROJECT_VERSION@

Requires: fastcdr
Requires.private: @private_requires_for_pc_file@
Cflags: -I${includedir}
Libs: -L${libdir} -lfastdds
24 changes: 24 additions & 0 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -391,3 +391,27 @@ install(FILES ${PROJECT_BINARY_DIR}/cmake/config/${PROJECT_NAME}-config.cmake
DESTINATION ${INSTALL_DESTINATION_PATH}
COMPONENT cmake
)

###############################################################################
# Create pkg-config file
###############################################################################
cmake_path(APPEND includedir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
cmake_path(APPEND libdir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_LIBDIR}")

set(private_requires_for_pc_file)
if (LINK_SSL)
list(APPEND private_requires_for_pc_file openssl)
endif()
if (TARGET tinyxml2::tinyxml2)
list(APPEND private_requires_for_pc_file tinyxml2)
endif()
list(JOIN private_requires_for_pc_file ", " private_requires_for_pc_file)

configure_file(
"${PROJECT_SOURCE_DIR}/fastdds.pc.in"
"${PROJECT_BINARY_DIR}/fastdds.pc"
@ONLY)
install(FILES "${PROJECT_BINARY_DIR}/fastdds.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
COMPONENT pkgconfig
)