MantisBT - CMake | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0014345 | CMake | (No Category) | public | 2013-08-08 04:56 | 2016-06-10 14:31 |
| Reporter | hyde | ||||
| Assigned To | Kitware Robot | ||||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | closed | Resolution | moved | ||
| Platform | OS | OS Version | |||
| Product Version | |||||
| Target Version | Fixed in Version | ||||
| Summary | 0014345: pkg_check_modules does not honor link command given by pkg-config: leaves out -L flag | ||||
| Description | Situation: A library is installed in a custom location, and it has pkg-config .pc file installed, `pkg-config --libs ...` gives correct link command. Library is added to project with "pkg-check-modules" in CMakeLists.txt. Running cmake succeeds and finds the library. Running make, compilation succeeds and correct -I option is added. Bug: only -l option is given for link command, and -L is not given, so linker does not find the library, and build fails. | ||||
| Steps To Reproduce | Minimal example to reproduce provided in attached .zip (please review all files before running/building, needs root for test lib install!). Overview of steps: Have a library in custom location, not in default linker search path. Have pkg-config file for the library, which gives correct compilation (-I) and linking flags (-l, -L). Add the library to a project with pkg_check_modules. Use a symbol from the library in source code. Build project. Linking fails, because -L is not added and linker does not find the library. | ||||
| Additional Information | Possibly related issue: http://www.cmake.org/Bug/view.php?id=8644 [^] It's possible there is something wrong with the project files (in the uploaded .zip), but they are fine as far as I can see. It's also possible there's something wrong with how cmake is set up in the Linux distro. Workaround: add to CMakeLists.txt explicit path for the custom library (also sets RPATH, be aware): link_directories(${XXXXX_LIBRARY_DIRS}) | ||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | https://public.kitware.com/Bug/file/4840/cmake_Lbug_sscce.zip | ||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2013-08-08 04:56 | hyde | New Issue | |||
| 2013-08-08 04:56 | hyde | File Added: cmake_Lbug_sscce.zip | |||
| 2013-08-08 04:59 | hyde | Note Added: 0033681 | |||
| 2013-08-08 06:27 | Rolf Eike Beer | Note Added: 0033682 | |||
| 2016-01-12 12:57 | Sam Thursfield | Note Added: 0040206 | |||
| 2016-06-10 14:29 | Kitware Robot | Note Added: 0042346 | |||
| 2016-06-10 14:29 | Kitware Robot | Status | new => resolved | ||
| 2016-06-10 14:29 | Kitware Robot | Resolution | open => moved | ||
| 2016-06-10 14:29 | Kitware Robot | Assigned To | => Kitware Robot | ||
| 2016-06-10 14:31 | Kitware Robot | Status | resolved => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||