GithubHelp home page GithubHelp logo

Comments (12)

rbrusu avatar rbrusu commented on May 27, 2024

Can you tell us how we could replicate this please?

from pcl.

nizar-sallem avatar nizar-sallem commented on May 27, 2024

This is probably due to the fact that geometry is a header only module that doesn't produce a binary library file.
Checking...

from pcl.

nizar-sallem avatar nizar-sallem commented on May 27, 2024

So apparently we don't handle the case where library is headers only for the generated pc files though we do it for the cmake.
Working on a fix.

from pcl.

nizar-sallem avatar nizar-sallem commented on May 27, 2024

@rbrusu I found a solution but I am not sure we want it pulled right now on PCL.
You can find it in my fork for now https://github.com/nizar-sallem/pcl.git then switch to "pkgconfig_fix" branch.

from pcl.

jspricke avatar jspricke commented on May 27, 2024

@nizar-sallem The branch is not on Github anymore, do you have some fix lying around?

from pcl.

martyvona avatar martyvona commented on May 27, 2024

For now the workaround we are using to get our pkg-config based build going is we manually create the file pcl_geometry-1.7.pc with these contents:

missing pkg-config file for pcl_geometry

prefix=/usr/local
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include/pcl-1.7
Name: pcl_geometry
Description: Point cloud geometry library
Version: 1.7.0
Requires:
Libs:
Cflags: -I${includedir}

You can then put that somewhere in the pkg-config search path, like /usr/local/lib/pkgconfig/. Though to avoid hacking up your system you can just keep the file local to your project build directory and use this command in place of the vanilla pkg-config call in your makefiles:

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:. pkg-config

from pcl.

jdt141 avatar jdt141 commented on May 27, 2024

I ran into the same issue and fixed it this way so that the proper pkg-config file will always be built when you build from source:

I create a new macro in pcl_targets.cmake:

macro(PCL_MAKE_PKGCONFIG_HEADER_ONLY _name _component _desc _pcl_deps _ext_deps _int_deps _cflags)
set(PKG_NAME ${_name})
set(PKG_DESC ${_desc})
set(PKG_CFLAGS ${_cflags})
#set(PKG_LIBFLAGS ${_lib_flags})
LIST_TO_STRING(_ext_deps_str "${_ext_deps}")
set(PKG_EXTERNAL_DEPS ${_ext_deps_str})
foreach(_dep ${_pcl_deps})
set(PKG_EXTERNAL_DEPS "${PKG_EXTERNAL_DEPS} pcl_${_dep}-${PCL_MAJOR_VERSION}.${PCL_MINOR_VERSION}")
endforeach(_dep)
set(PKG_INTERNAL_DEPS "")
foreach(_dep ${_int_deps})
set(PKG_INTERNAL_DEPS "${PKG_INTERNAL_DEPS} -l${_dep}")
endforeach(_dep)
set(_pc_file ${CMAKE_CURRENT_BINARY_DIR}/${_name}-${PCL_MAJOR_VERSION}.${PCL_MINOR_VERSION}.pc)
configure_file(${PROJECT_SOURCE_DIR}/cmake/pkgconfig-headeronly.cmake.in ${_pc_file} @ONLY)
install(FILES ${_pc_file} DESTINATION ${PKGCFG_INSTALL_DIR}
COMPONENT pcl_${_component})
endmacro(PCL_MAKE_PKGCONFIG_HEADER_ONLY)

I also added a file: pkgconfig-headeronly.cmake.in to the same directory. It looks like this:

# This file was generated by CMake for @PROJECT_NAME@ library @PKG_NAME@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/@LIB_INSTALL_DIR@
#includedir=${prefix}/@INCLUDE_INSTALL_DIR@
includedir=${prefix}/include/@PROJECT_NAME_LOWER@-@PCL_MAJOR_VERSION@.@PCL_MINOR_VERSION@
Name: @PKG_NAME@
Description: @PKG_DESC@
Version: @PCL_VERSION@
Requires: @PKG_EXTERNAL_DEPS@
Libs: 
Cflags: -I${includedir} @PKG_CFLAGS@

Then I called PCL_MAKE_PKGCONFIG_HEADER_ONLY from geometry/CMakeLists.txt. Works like a charm!

from pcl.

martyvona avatar martyvona commented on May 27, 2024

Great, that sounds like a fix that could be included in pcl to resolve this issue, not just a workaround. Thanks!

from pcl.

jspricke avatar jspricke commented on May 27, 2024

@jdt141 looking good, can you send it as a pull request, so we can merge it? Thanks!

from pcl.

rbrusu avatar rbrusu commented on May 27, 2024

+1 for a pull request.

from pcl.

jdt141 avatar jdt141 commented on May 27, 2024

Just submitted the request. HTH!

from pcl.

jspricke avatar jspricke commented on May 27, 2024

merged, thanks!

from pcl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.