From 1a3440374dbc42fa027524906cc3a1a80854c0e3 Mon Sep 17 00:00:00 2001 From: rti Date: Thu, 27 Jan 2011 18:00:21 +0100 Subject: [PATCH] Fixed: #1248 CMake Error: get_filename_component unknown component --- code/CMakeModules/CheckDepends.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/CMakeModules/CheckDepends.cmake b/code/CMakeModules/CheckDepends.cmake index c7e691cc8..893582581 100644 --- a/code/CMakeModules/CheckDepends.cmake +++ b/code/CMakeModules/CheckDepends.cmake @@ -55,7 +55,7 @@ MACRO(CHECK_LINKED_LIBRARY MYLIBRARY OTHERLIBRARY LIBRARY_FOUND) SET(CMAKE_OTOOL otool) IF(CMAKE_OTOOL) # Use otool to check if a library is linked to another library - GET_FILENAME_COMPONENT(LIBNAME ${${OTHERLIBRARY}} NAME_WE) + GET_FILENAME_COMPONENT(LIBNAME "${${OTHERLIBRARY}}" NAME_WE) EXEC_PROGRAM(${CMAKE_OTOOL} ARGS "-L ${${MYLIBRARY}} | grep ${LIBNAME}" OUTPUT_VARIABLE OTOOL_LIBRARY) # MESSAGE(STATUS "Checking if ${LIBNAME} is linked to ${${MYLIBRARY}}") IF(OTOOL_LIBRARY MATCHES "${LIBNAME}") @@ -65,7 +65,7 @@ MACRO(CHECK_LINKED_LIBRARY MYLIBRARY OTHERLIBRARY LIBRARY_FOUND) ENDIF(CMAKE_OTOOL) ELSEIF(UNIX) IF(CMAKE_OBJDUMP) - GET_FILENAME_COMPONENT(LIBNAME ${${OTHERLIBRARY}} NAME) + GET_FILENAME_COMPONENT(LIBNAME "${${OTHERLIBRARY}}" NAME) # TODO: under Solaris use dump -Lv # Use objdump to check if a library is linked to another library EXEC_PROGRAM(${CMAKE_OBJDUMP} ARGS "-p ${${MYLIBRARY}} | grep ${LIBNAME}" OUTPUT_VARIABLE OBJDUMP_LIBRARY)