From cb95c0a5bc86387a518002d842ffe22b9ad67958 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 9 Mar 2006 11:35:38 -0500 Subject: [PATCH] ENH: fix a bug in the find path stuff so that it can find headers deep in frameworks --- Modules/FindTCL.cmake | 20 -------------------- Source/cmFindPathCommand.cxx | 30 +++++++++++++++--------------- 2 files changed, 15 insertions(+), 35 deletions(-) diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake index aca36b566..79a4611bd 100644 --- a/Modules/FindTCL.cmake +++ b/Modules/FindTCL.cmake @@ -150,26 +150,6 @@ IF (WIN32) ) ENDIF(WIN32) -IF(Tcl_FRAMEWORKS) - # If we are using the Tcl framework, link to it. - IF("${TCL_INCLUDE_PATH}" MATCHES "Tcl\\.framework") - SET(TCL_LIBRARY "") - ENDIF("${TCL_INCLUDE_PATH}" MATCHES "Tcl\\.framework") - IF(NOT TCL_LIBRARY) - SET (TCL_LIBRARY "-framework Tcl" CACHE FILEPATH "Tcl Framework" FORCE) - ENDIF(NOT TCL_LIBRARY) -ENDIF(Tcl_FRAMEWORKS) - -IF(Tk_FRAMEWORKS) - # If we are using the Tk framework, link to it. - IF("${TK_INCLUDE_PATH}" MATCHES "Tk\\.framework") - SET(TK_LIBRARY "") - ENDIF("${TK_INCLUDE_PATH}" MATCHES "Tk\\.framework") - IF(NOT TK_LIBRARY) - SET (TK_LIBRARY "-framework Tk" CACHE FILEPATH "Tk Framework" FORCE) - ENDIF(NOT TK_LIBRARY) -ENDIF(Tk_FRAMEWORKS) - MARK_AS_ADVANCED( TCL_STUB_LIBRARY TCL_STUB_LIBRARY_DEBUG diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 6ece32a75..eecdfa1e3 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -164,24 +164,24 @@ std::string cmFindPathCommand::FindHeaderInFramework(std::string& file, return fpath; } } - // if it is not found yet or not a framework header, then do a glob search - // for all files in dir/*/Headers/ - cmStdString glob = dir; - glob += "/*/Headers/"; - glob += file; - cmGlob globIt; - globIt.FindFiles(glob); - std::vector files = globIt.GetFiles(); - if(files.size()) + } + // if it is not found yet or not a framework header, then do a glob search + // for all files in dir/*/Headers/ + cmStdString glob = dir; + glob += "/*/Headers/"; + glob += file; + cmGlob globIt; + globIt.FindFiles(glob); + std::vector files = globIt.GetFiles(); + if(files.size()) + { + cmStdString fheader = cmSystemTools::CollapseFullPath(files[0].c_str()); + if(this->IncludeFileInPath) { - cmStdString fheader = cmSystemTools::CollapseFullPath(files[0].c_str()); - if(this->IncludeFileInPath) - { - return fheader; - } - fheader = cmSystemTools::GetFilenamePath(fheader); return fheader; } + fheader = cmSystemTools::GetFilenamePath(fheader); + return fheader; } return ""; }