dev-db/mysql-connector-c++ (up to and including version 1.1.1) has a really ugly parse to get what it call "MySQL Link Flags". In short what it does is in "${S}/FindMySQL.cm": EXECUTE_PROCESS(COMMAND ${MYSQL_CONFIG_EXECUTABLE} "--cflags" OUTPUT_VARIABLE _mysql_config_output ) STRING(REGEX MATCHALL "-m([^\r\n]+)" MYSQL_LINK_FLAGS "${_mysql_config_output}") The problem with this? MYSQL_LINK_FLAGS gets totally empty unless you have a CFLAG that contains "-m". This leads to two problems by default: 1) I you do not have a CFLAG that starts with "-m" then this gets empty. If you do have such flag, but it is not in the beginning, then only the flags following the "-m" flags gets picked (and still all of them). 2) If you have a flag that *contains*, but *does not start* with "-m", for example -floop-strip-mine", then there is a high possiblity that your build will break due to gcc/g++ not recognizing the flag "-mine". This is probably something that should go upstream, but I currently do not have the time to register/report there, learn cmake enough to actually figure out a clean fix and track it. So if someone else finds the time, please do that. I am myself currently using a ugly hack to at least work around 2, which is: -STRING(REGEX MATCHALL "-m([^\r\n]+)" MYSQL_LINK_FLAGS "${_mysql_config_output}") +STRING(REGEX MATCHALL " -m([^\r\n]+)" MYSQL_LINK_FLAGS " ${_mysql_config_output}")
*** Bug 474866 has been marked as a duplicate of this bug. ***
Change added with version bump to 1.1.3. Please test and confirm.
Marking as fixed as there has been no further comment in months
Created attachment 385924 [details, diff] The patch updated not to break the build with recent cmake versions. The original patch now breaks the build, since recent versions of cmake (3+?) treat starting whitesapce in the string that results from " -m([^\r\n]+)" as an error. Changing space into \< helps.