[CMake] Bug in FindwxWidgets.cmake

Michael DiCuccio dicuccio at gmail.com
Wed Sep 25 10:40:07 EDT 2013


Hi!

I've tripped across a bug in FindwxWidgets.cmake, in which (on Linux/Unix)
paths returned by wxconfig will be modified if their path names contain a
'-D'.  The patch below fixes this.  Can this please be applied?  Thanks!

--- FindwxWidgets.cmake.orig    2013-09-25 10:34:52.835469000 -0400
+++ FindwxWidgets.cmake 2013-09-25 10:33:39.826506000 -0400
@@ -738,13 +738,13 @@

         # parse definitions from cxxflags;
         #   drop -D* from CXXFLAGS and the -D prefix
-        string(REGEX MATCHALL "-D[^;]+"
+        string(REGEX MATCHALL "\\<-D[^;]+"
           wxWidgets_DEFINITIONS  "${wxWidgets_CXX_FLAGS}")
-        string(REGEX REPLACE "-D[^;]+(;|$)" ""
+        string(REGEX REPLACE "\\<-D[^;]+(;|$)" ""
           wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
         string(REGEX REPLACE ";$" ""
           wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
-        string(REPLACE "-D" ""
+        string(REPLACE "\\<-D" ""
           wxWidgets_DEFINITIONS "${wxWidgets_DEFINITIONS}")

         # parse include dirs from cxxflags; drop -I prefix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130925/60e051e1/attachment.htm>


More information about the CMake mailing list