Giter Site home page Giter Site logo

Comments (7)

srinathv2 avatar srinathv2 commented on August 16, 2024

@tt4g you can check this https://cmake.org/cmake/help/latest/command/target_link_libraries.html#target-link-libraries:~:text=A%20plain%20library%20name%3A%20The%20generated%20link%20line%20will%20ask%20the%20linker%20to%20search%20for%20the%20library%20(e.g.%20foo%20becomes%20%2Dlfoo%20or%20foo.lib).

from libpqxx.

tt4g avatar tt4g commented on August 16, 2024

you can check this

You repeatedly asked your own question in #383,
Is that comment the only one that explains the behavior I did not understand?
If so, I already know its CMake behavior specification.

What I didn't understand was that find_package() should also look for libraries in the PATH environment variable, but it failed to do so.
Nevertheless, when I pass only a string to target_link_libraries(), it is able to link.
This is because the fact that it is linked means that libpq was found somewhere in the path contained in the PATH environment variable.
This behavior appears to be inconsistent,
Furthermore, find_package() could not find libpq when I defined the PostgreSQL_ROOT variable.
The only way to investigate the reason for this would be to look at #383 author's machine.

from libpqxx.

srinathv2 avatar srinathv2 commented on August 16, 2024

@tt4g this is not about any issue i was letting you know,how target_link_libraries works when you give lib name

from libpqxx.

tt4g avatar tt4g commented on August 16, 2024

I don't know what you want to do by telling me that.

from libpqxx.

srinathv2 avatar srinathv2 commented on August 16, 2024

@tt4g

What I didn't understand was that find_package() should also look for libraries in the PATH environment variable, but it failed to do so.

find_package tries to search the for -config.cmake or Config.cmake and it helps to find the lib's includes,binaries.We can specify the path to this file before find_package using set(packagename_DIR path),i agree it searches for the Config.cmake file in this order CMAKE_PREFIX_PATH,PATH you can check https://cmake.org/cmake/help/latest/command/find_package.html#search-procedure how find_package searches for the config file

from libpqxx.

srinathv2 avatar srinathv2 commented on August 16, 2024

I don't know what you want to do by telling me that.

@tt4g i saw the comment #383 (comment) and just thought to help and learn,nothing else.

from libpqxx.

tt4g avatar tt4g commented on August 16, 2024

Suddenly such a comment is lost on me.
Because you were commenting on how to link a customized libpq just prior to that.

from libpqxx.

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.