I came across a problem when porting to another Unix platform today with wxWidgets_CXX_FLAGS. There's a bug in how it parses and removes definitions from wx-config's cxxflags output. I suspect this class of bug applies to all pkg-config like and other gcc compile flags parsing routines.
In essence, the following two regex replaces need to be included when trying to remove definitions: STRING(REGEX REPLACE ";-D[^;]+$" "" wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}") STRING(REGEX REPLACE "^-D[^;]+$" "" wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}") The first properly removes definitions that exist at the end of the flags. The second properly removes a definition if it is the only component of the C[XX]FLAGS. I suspect a similar problem exists for includes when includes are the only component of the flags. Andrew Sayman _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake