[cmake-developers] [CMake 0015746]: pkg_check_modules should document how to handle spaces in framework names
Mantis Bug Tracker
mantis at public.kitware.com
Tue Sep 15 15:20:30 EDT 2015
The following issue has been SUBMITTED.
======================================================================
https://public.kitware.com/Bug/view.php?id=15746
======================================================================
Reported By: Dan Kegel
Assigned To:
======================================================================
Project: CMake
Issue ID: 15746
Category: CMake
Reproducibility: always
Severity: minor
Priority: normal
Status: new
======================================================================
Date Submitted: 2015-09-15 15:20 EDT
Last Modified: 2015-09-15 15:20 EDT
======================================================================
Summary: pkg_check_modules should document how to handle
spaces in framework names
Description:
pc files don't often have spaces in values, but it does happen (especially on
the Mac), and a little guidance would be helpful.
http://kegel.com/cmake/spaces-in-framework-names/ is a worked example
of how to cope with framework names that contain spaces. The idea is:
- the .pc file should use a backslash in front of each space in the name
(quotes don't seem to work)
- the CMakeLists.txt should use string(REPLACE...) to replace semicolons
with spaces and/or single quote marks, as appropriate
For instance:
string(REPLACE "-framework;foo;bar" "-framework 'foo bar'" foo_LDFLAGS
"${foo_LDFLAGS}")
Steps to Reproduce:
On a mac:
$ tar -xzvf spaces-in-framework-names.tgz
$ cd spaces-in-framework-names
# comment out the string(REPLACE...) in CMakeLists.txt to demonstrate problem
$ sh demo.sh
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2015-09-15 15:20 Dan Kegel New Issue
2015-09-15 15:20 Dan Kegel File Added: spaces-in-framework-names.tgz
======================================================================
More information about the cmake-developers
mailing list