[cmake-developers] [CMake 0015087]: Bug in FindwxWidgets.cmake causes build failure when more than one C flag is used.

Mantis Bug Tracker mantis at public.kitware.com
Thu Aug 14 16:17:44 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=15087 
====================================================================== 
Reported By:                hobbes1069
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15087
Category:                   Modules
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-08-14 16:17 EDT
Last Modified:              2014-08-14 16:17 EDT
====================================================================== 
Summary:                    Bug in FindwxWidgets.cmake causes build failure when
more than one C flag is used.
Description: 
FindwxWidgets.cmake parses the output of wx-config and converts it to a list.
The definitions and includes seem to be processed appropriately but whatever is
left is considered a CXX flag.

If more than one flag remains it is left as a cmake list, i.e.:
"-mthreads;-fpermissive" which gcc chokes on.

On both my Fedora and Fedora mingw-w64 installs only one flag is used and the
issue doesn't crop up.

Steps to Reproduce: 
Attempt to build a cmake based project that uses wxWidgets with more than one
build flag.

Additional Information: 
The following patch worked for me but should be reviewed for appropriateness:

diff -Naur cmake-3.0.1.orig/Modules/FindwxWidgets.cmake
cmake-3.0.1.wxfix/Modules/FindwxWidgets.cmake
--- cmake-3.0.1.orig/Modules/FindwxWidgets.cmake        2014-07-31
10:03:56.000000000 -0500
+++ cmake-3.0.1.wxfix/Modules/FindwxWidgets.cmake       2014-08-14
12:02:11.604331400 -0500
@@ -792,6 +792,10 @@
           wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
         string(REPLACE "-I" ""
           wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")
+
+               # Flags are a string, not a list, fix it here
+               string(REPLACE ";" " "
+                 wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")

         DBG_MSG_V("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}")
         DBG_MSG_V("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}")

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-08-14 16:17 hobbes1069     New Issue                                    
======================================================================



More information about the cmake-developers mailing list