Merge topic 'revert-automoc-src-per-dir'
091b649e
Revert "Automoc: Fix support of files with the same name (#12873)"
This commit is contained in:
commit
be98577f13
|
@ -1104,39 +1104,10 @@ void cmQtAutoGenerators::ParseHeaders(const std::set<std::string>& absHeaders,
|
|||
std::cout << "AUTOGEN: Checking " << headerName << std::endl;
|
||||
}
|
||||
|
||||
std::string headerDirectory;
|
||||
if (cmsys::SystemTools::IsSubDirectory(headerName,
|
||||
this->ProjectSourceDir))
|
||||
{
|
||||
headerDirectory = this->ProjectSourceDir;
|
||||
}
|
||||
else if (cmsys::SystemTools::IsSubDirectory(headerName,
|
||||
this->ProjectBinaryDir))
|
||||
{
|
||||
headerDirectory = this->ProjectBinaryDir;
|
||||
}
|
||||
else
|
||||
{
|
||||
cmsys::SystemTools::SplitPathRootComponent(headerName,
|
||||
&headerDirectory);
|
||||
}
|
||||
const std::string basename = cmsys::SystemTools::
|
||||
GetFilenameWithoutLastExtension(headerName);
|
||||
|
||||
std::string baseHeaderName =
|
||||
cmsys::SystemTools::GetFilenameWithoutLastExtension(headerName);
|
||||
|
||||
headerDirectory = cmsys::SystemTools::RelativePath(
|
||||
headerDirectory, cmsys::SystemTools::GetParentDirectory(headerName));
|
||||
|
||||
if (!headerDirectory.empty())
|
||||
{
|
||||
headerDirectory += "/";
|
||||
}
|
||||
|
||||
std::string mocName = headerDirectory + baseHeaderName;
|
||||
|
||||
cmSystemTools::ReplaceString(mocName, "/", "_");
|
||||
|
||||
const std::string currentMoc = "moc_" + mocName + ".cpp";
|
||||
const std::string currentMoc = "moc_" + basename + ".cpp";
|
||||
std::string macroName;
|
||||
if (requiresMocing(contents, macroName))
|
||||
{
|
||||
|
|
|
@ -3,6 +3,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
|
||||
|
||||
add_library(libA SHARED libA.cpp foo.cpp bar/foo.cpp)
|
||||
add_library(libA SHARED libA.cpp)
|
||||
target_link_libraries(libA LINK_PUBLIC ${QT_QTCORE_TARGET})
|
||||
generate_export_header(libA)
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
#include "foo.h"
|
||||
|
||||
bar::foo::foo() {}
|
||||
bar::foo::~foo() {}
|
|
@ -1,10 +0,0 @@
|
|||
#include <QObject>
|
||||
|
||||
namespace bar {
|
||||
class foo: public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
foo();
|
||||
~foo();
|
||||
};
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
#include "foo.h"
|
||||
|
||||
foo::foo() {}
|
||||
foo::~foo() {}
|
|
@ -1,8 +0,0 @@
|
|||
#include <QObject>
|
||||
|
||||
class foo: public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
foo();
|
||||
~foo();
|
||||
};
|
Loading…
Reference in New Issue