From 6de751cd83bb36e2f70d3401ca05c7f4e6518eb0 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Tue, 14 Oct 2014 19:44:41 +0300 Subject: [PATCH] Fixed CMake configuration error with -DEMBEDDED_LIB= causing the library not being found. --- macros.cmake | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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)