[cmake-developers] [CMake 0012317]: pkg_check_modules produces output incompatible with other cmake variables

Mantis Bug Tracker mantis at public.kitware.com
Tue Jul 5 19:11:53 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12317 
====================================================================== 
Reported By:                Aaron Simmons
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12317
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2011-07-05 19:11 EDT
Last Modified:              2011-07-05 19:11 EDT
====================================================================== 
Summary:                    pkg_check_modules produces output incompatible with
other cmake variables
Description: 
Using pkg_check_modules outputs XXX_LDFLAGS as a list (semi-colon delimited)
whereas CMAKE_EXE_LINKER_FLAGS requires a flat space-delimited string.



Steps to Reproduce: 
Run this code on Ubuntu 11.04:
   # setup glib2
   pkg_check_modules(GLIB2 REQUIRED glib-2.0)
   message("GLIB2_LDFLAGS= ${GLIB2_LDFLAGS}")   
   add_definitions(${GLIB2_CFLAGS} ${GLIB2_CFLAGS_OTHER})
   set( CMAKE_EXE_LINKER_FLAGS ${GLIB2_LDFLAGS})
This will output:
   GLIB2_LDFLAGS= -L/usr/lib/i386-linux-gnu;-lglib-2.0
which when put into CMAKE_EXE_LINKER_FLAGS, will create invalid flags for gcc--
it will literally emit "-L/usr/lib/i386-linux-gnu;-lglib-2.0" to the
command-line.




Additional Information: 
It's unclear how pkg_check_modules is intended to be used-- are we supposed to
write custom code transform its output?  Why?

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-07-05 19:11 Aaron Simmons  New Issue                                    
======================================================================




More information about the cmake-developers mailing list