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

Correctly setup pkg config file #49

Open
wants to merge 2 commits into
base: rm_rock_macros
Choose a base branch
from
Open
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
20 changes: 11 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set(SOURCES
tools/TraversabilityGrassfire.cpp
)

add_library(${PROJECT_NAME} ${SOURCES})
add_library(${PROJECT_NAME} SHARED ${SOURCES})
target_link_libraries(${PROJECT_NAME}
PUBLIC
PkgConfig::DEPS
Expand All @@ -33,8 +33,7 @@ target_link_libraries(${PROJECT_NAME}
${PCL_IO_LIBRARIES}
)

target_include_directories(${PROJECT_NAME}
PUBLIC
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
${PCL_INCLUDE_DIRS}
Expand All @@ -57,13 +56,16 @@ install (TARGETS
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

set(PKGCONFIG_CFLAGS)
set(PKGCONFIG_REQUIRES
base-types
base-logging
boost_serialization
pcl_io-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}
set(PKG_CONFIG_DEPS
base-types
base-logging
boost_serialization
pcl_io-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}
)

set(PKGCONFIG_CFLAGS)
list(JOIN PKG_CONFIG_DEPS " " PKGCONFIG_REQUIRES)

configure_file(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
Expand Down