From b96f6fc2aabed8a77cd45c0f87af7abb6a687576 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 26 Nov 2012 16:44:56 -0500 Subject: Teach find_(path|file) about Linux multiarch (#13742) Implement support for multiarch include directories as specified here: https://wiki.ubuntu.com/MultiarchCross Generalize the multiarch feature added in commit b41ad3b3 (Teach find_(library|package) about Linux multiarch, 2011-06-08) to the find_path and find_file commands. Teach them to search /include/ whenever they would search /include. --- Source/cmFindBase.cxx | 4 ++-- Source/cmFindPathCommand.cxx | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 1de3982..7ce0032 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -360,13 +360,13 @@ void cmFindBase::AddPrefixPaths(std::vector const& in_paths, { dir += "/"; } - if(subdir == "lib") + if(subdir == "include" || subdir == "lib") { const char* arch = this->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE"); if(arch && *arch) { - this->AddPathInternal(dir+"lib/"+arch, pathType); + this->AddPathInternal(dir+subdir+"/"+arch, pathType); } } std::string add = dir + subdir; diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 9524924..6a43298 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -45,8 +45,10 @@ void cmFindPathCommand::GenerateDocumentation() "SEARCH_XXX", "file in a directory"); cmSystemTools::ReplaceString(this->GenericDocumentation, "XXX_SUBDIR", "include"); - cmSystemTools::ReplaceString(this->GenericDocumentation, - "XXX_EXTRA_PREFIX_ENTRY", ""); + cmSystemTools::ReplaceString( + this->GenericDocumentation, + "XXX_EXTRA_PREFIX_ENTRY", + " /include/ if CMAKE_LIBRARY_ARCHITECTURE is set, and\n"); cmSystemTools::ReplaceString(this->GenericDocumentation, "CMAKE_FIND_ROOT_PATH_MODE_XXX", "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE"); -- cgit v0.12