Skip to content

Commit 145e63e

Browse files
committed
Patch to fix mysql_config multi line -I -L (kudos to Kent!)
1 parent 720ab0b commit 145e63e

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

FindMySQL.cmake

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,20 @@ elseif(MYSQL_CONFIG_EXECUTABLE)
495495
"\"${MYSQL_CONFIG_EXECUTABLE}\"")
496496
endif()
497497

498-
if(NOT EXISTS "${MYSQL_INCLUDE_DIR}/mysql.h")
498+
set(_found_mysql_h)
499+
foreach(_incdir ${MYSQL_INCLUDE_DIR})
500+
if(NOT EXISTS "${_incdir}")
501+
message(FATAL_ERROR "Could not find the directory \"${_incdir}\" "
502+
"from running \"${MYSQL_CONFIG_EXECUTABLE}\"")
503+
endif()
504+
if(EXISTS "${_incdir}/mysql.h")
505+
set(_found_mysql_h 1)
506+
endif()
507+
endforeach()
508+
509+
if(NOT _found_mysql_h)
499510
message(FATAL_ERROR "Could not find \"mysql.h\" in \"${MYSQL_INCLUDE_DIR}\" "
500-
"found from running \"${MYSQL_CONFIG_EXECUTABLE}\"")
511+
"from running \"${MYSQL_CONFIG_EXECUTABLE}\"")
501512
endif()
502513

503514
else()
@@ -583,10 +594,12 @@ elseif(MYSQL_CONFIG_EXECUTABLE)
583594
"\"${MYSQL_CONFIG_EXECUTABLE}\"")
584595
endif()
585596

586-
if(NOT EXISTS "${MYSQL_LIB_DIR}")
587-
message(FATAL_ERROR "Could not find the directory \"${MYSQL_LIB_DIR}\" "
588-
"found from running \"${MYSQL_CONFIG_EXECUTABLE}\"")
589-
endif()
597+
foreach(_libdir ${MYSQL_LIB_DIR})
598+
if(NOT EXISTS "${_libdir}")
599+
message(FATAL_ERROR "Could not find the directory \"${_libdir}\" "
600+
"from running \"${MYSQL_CONFIG_EXECUTABLE}\"")
601+
endif()
602+
endforeach()
590603

591604
# We have the assumed MYSQL_LIB_DIR. The output from "mysql_config"
592605
# might not be correct for static libraries, so we might need to

0 commit comments

Comments
 (0)