diff --git a/macros.cmake b/macros.cmake index 3b75fcfa6..d8f1b7827 100644 --- a/macros.cmake +++ b/macros.cmake @@ -127,13 +127,17 @@ debugmsg("Search returned: ${MYSQL_DIR_LOC}") # Find the embedded mysql library if (DEFINED EMBEDDED_LIB) - debugmsg("Searching for the embedded library at: ${EMBEDDED_LIB}") - if(${CMAKE_VERSION} VERSION_LESS 2.12 ) - set(COMP_VAR PATH) - else() - set(COMP_VAR DIRECTORY) + if( NOT (IS_DIRECTORY ${EMBEDDED_LIB}) ) + debugmsg("EMBEDDED_LIB is not a directory: ${EMBEDDED_LIB}") + if(${CMAKE_VERSION} VERSION_LESS 2.12 ) + set(COMP_VAR PATH) + else() + set(COMP_VAR DIRECTORY) + endif() + get_filename_component(EMBEDDED_LIB ${EMBEDDED_LIB} ${COMP_VAR}) + debugmsg("EMBEDDED_LIB directory component: ${EMBEDDED_LIB}") endif() - get_filename_component(EMBEDDED_LIB ${EMBEDDED_LIB} ${COMP_VAR}) + debugmsg("Searching for the embedded library at: ${EMBEDDED_LIB}") endif() if(STATIC_EMBEDDED)