View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015805CMakeModulespublic2015-10-20 17:182016-06-10 14:31
ReporterSam Thursfield 
Assigned ToBen Boeckel 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0015805: pkg_get_variable from FindPkgConfig should honour search path from CMAKE_PREFIX_PATH
DescriptionThe pkg_get_variable function from FindPkgConfig.cmake that is added in CMake 3.4.0 is really useful! However, it needs to honour the same search path as pkg_check_modules, otherwise it doesn't work when packages are not installed in standard prefixes
Steps To ReproduceUse attached test case

Expected output:

Magic word is: xyzzy

Actual output:

Package cmake-pkgconfig-test was not found in the pkg-config search path.
Perhaps you should add the directory containing `cmake-pkgconfig-test.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cmake-pkgconfig-test' found
CMake Error at CMakeLists.txt:15 (message):
  Did not pick up magic_word variable from cmake-pkgconfig-test.pc

TagsNo tags attached.
Attached Files? file icon cmake-pkg-get-variable-testcase.sh [^] (685 bytes) 2015-10-20 17:18
patch file icon cmake-pkg-get-variable-search-path.patch [^] (7,953 bytes) 2015-10-20 17:19 [Show Content]

 Relationships
related to 0015804closedKitware Robot FindPkgConfig pkg_check_modules command should return full path to shared libraries in _LIBRARIES variable 

  Notes
(0039659)
Sam Thursfield (reporter)
2015-10-20 17:19

Patch attached
(0039660)
Ben Boeckel (developer)
2015-10-20 17:28

Thanks. I hadn't considered that case. I'll look into trying to write a test case for it as well.
(0039661)
Ben Boeckel (developer)
2015-10-20 17:29

Well, a test case in the test suite :) .
(0039662)
Ben Boeckel (developer)
2015-10-20 17:59

Alright, I have your patch amended to keep the current test suite passing (you missed using $ENV{} when saving the old value). I'll work on a test cases for CMAKE_PREFIX_PATH this week.
(0039672)
Rolf Eike Beer (developer)
2015-10-23 16:21

There are some needless or dangerous variable dereferences, like

 if (NOT "${foo}" STREQUAL "")

Just use

 if (NOT foo STREQUAL "")
(0039673)
Ben Boeckel (developer)
2015-10-23 17:23

Fixed on the branch I made (for the bits that moved at least).
(0042864)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2015-10-20 17:18 Sam Thursfield New Issue
2015-10-20 17:18 Sam Thursfield File Added: cmake-pkg-get-variable-testcase.sh
2015-10-20 17:19 Sam Thursfield Note Added: 0039659
2015-10-20 17:19 Sam Thursfield File Added: cmake-pkg-get-variable-search-path.patch
2015-10-20 17:28 Ben Boeckel Assigned To => Ben Boeckel
2015-10-20 17:28 Ben Boeckel Status new => assigned
2015-10-20 17:28 Ben Boeckel Note Added: 0039660
2015-10-20 17:29 Ben Boeckel Note Added: 0039661
2015-10-20 17:59 Ben Boeckel Note Added: 0039662
2015-10-21 08:28 Brad King Relationship added related to 0015804
2015-10-23 16:21 Rolf Eike Beer Note Added: 0039672
2015-10-23 17:23 Ben Boeckel Note Added: 0039673
2016-06-10 14:29 Kitware Robot Note Added: 0042864
2016-06-10 14:29 Kitware Robot Status assigned => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team