diff options
author | Brad King <brad.king@kitware.com> | 2016-08-15 12:59:46 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-08-15 12:59:46 (GMT) |
commit | 33d4aff50d50907d05b49c92ed01376264d84389 (patch) | |
tree | 2e69f1fdcf0907c816f60c3c1f352facbf0a8340 /Tests | |
parent | d47abe40b6532095fa28f5f1305e2ecad5feb6b7 (diff) | |
parent | 61a607e8d43e0d02ff80cca6e60441f56a6741b5 (diff) | |
download | CMake-33d4aff50d50907d05b49c92ed01376264d84389.zip CMake-33d4aff50d50907d05b49c92ed01376264d84389.tar.gz CMake-33d4aff50d50907d05b49c92ed01376264d84389.tar.bz2 |
Merge topic 'autogen-same-name'
61a607e8 Help: Document AUTORCC behavior for same .qrc name case
e4f508e4 Tests/QtAutogen: Test same moc/qrc source names in different directories
4e9b97d7 QtAutogen: Allow multiple qrc files with the same name
41c9e14a QtAutogen: Allow multiple moc files with the same name
3c3b37b0 QtAutogen: Use std:: instead of ::std::
0a5dd3c7 cmFilePathUuid: Add class to generate deterministic unique file names
Diffstat (limited to 'Tests')
21 files changed, 237 insertions, 0 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index d5aca55..e35e1d1 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -110,6 +110,10 @@ set_target_properties( AUTOMOC TRUE ) +# Test AUTOMOC and AUTORCC on source files with the same name +# but in different subdirectories +add_subdirectory(sameName) + include(GenerateExportHeader) # The order is relevant here. B depends on A, and B headers depend on A # headers both subdirectories use CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE and we diff --git a/Tests/QtAutogen/sameName/CMakeLists.txt b/Tests/QtAutogen/sameName/CMakeLists.txt new file mode 100644 index 0000000..ed045fb --- /dev/null +++ b/Tests/QtAutogen/sameName/CMakeLists.txt @@ -0,0 +1,21 @@ +# Test AUTOMOC and AUTORCC on source files with the same name +# but in different subdirectories + +add_executable(sameName + aaa/bbb/item.cpp + aaa/bbb/data.qrc + aaa/item.cpp + aaa/data.qrc + bbb/aaa/item.cpp + bbb/aaa/data.qrc + bbb/item.cpp + bbb/data.qrc + ccc/item.cpp + ccc/data.qrc + item.cpp + data.qrc + main.cpp +) +target_include_directories(sameName PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_link_libraries(sameName ${QT_LIBRARIES}) +set_target_properties( sameName PROPERTIES AUTOMOC TRUE AUTORCC TRUE ) diff --git a/Tests/QtAutogen/sameName/aaa/bbb/data.qrc b/Tests/QtAutogen/sameName/aaa/bbb/data.qrc new file mode 100644 index 0000000..0ea3537 --- /dev/null +++ b/Tests/QtAutogen/sameName/aaa/bbb/data.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="aaa/bbb"> + <file>item.hpp</file> + <file>item.cpp</file> +</qresource> +</RCC> diff --git a/Tests/QtAutogen/sameName/aaa/bbb/item.cpp b/Tests/QtAutogen/sameName/aaa/bbb/item.cpp new file mode 100644 index 0000000..20d0044 --- /dev/null +++ b/Tests/QtAutogen/sameName/aaa/bbb/item.cpp @@ -0,0 +1,10 @@ +#include "item.hpp" + +namespace aaa { +namespace bbb { + +void Item::go() +{ +} +} +} diff --git a/Tests/QtAutogen/sameName/aaa/bbb/item.hpp b/Tests/QtAutogen/sameName/aaa/bbb/item.hpp new file mode 100644 index 0000000..0855043 --- /dev/null +++ b/Tests/QtAutogen/sameName/aaa/bbb/item.hpp @@ -0,0 +1,18 @@ +#ifndef AAA_BBB_ITEM_HPP +#define AAA_BBB_ITEM_HPP + +#include <QObject> + +namespace aaa { +namespace bbb { + +class Item : public QObject +{ + Q_OBJECT + Q_SLOT + void go(); +}; +} +} + +#endif diff --git a/Tests/QtAutogen/sameName/aaa/data.qrc b/Tests/QtAutogen/sameName/aaa/data.qrc new file mode 100644 index 0000000..379af60 --- /dev/null +++ b/Tests/QtAutogen/sameName/aaa/data.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="aaa/"> + <file>item.hpp</file> + <file>item.cpp</file> +</qresource> +</RCC> diff --git a/Tests/QtAutogen/sameName/aaa/item.cpp b/Tests/QtAutogen/sameName/aaa/item.cpp new file mode 100644 index 0000000..95dd3b6 --- /dev/null +++ b/Tests/QtAutogen/sameName/aaa/item.cpp @@ -0,0 +1,8 @@ +#include "item.hpp" + +namespace aaa { + +void Item::go() +{ +} +} diff --git a/Tests/QtAutogen/sameName/aaa/item.hpp b/Tests/QtAutogen/sameName/aaa/item.hpp new file mode 100644 index 0000000..b63466f --- /dev/null +++ b/Tests/QtAutogen/sameName/aaa/item.hpp @@ -0,0 +1,16 @@ +#ifndef AAA_ITEM_HPP +#define AAA_ITEM_HPP + +#include <QObject> + +namespace aaa { + +class Item : public QObject +{ + Q_OBJECT + Q_SLOT + void go(); +}; +} + +#endif diff --git a/Tests/QtAutogen/sameName/bbb/aaa/data.qrc b/Tests/QtAutogen/sameName/bbb/aaa/data.qrc new file mode 100644 index 0000000..da98009 --- /dev/null +++ b/Tests/QtAutogen/sameName/bbb/aaa/data.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="bbb/aaa/"> + <file>item.hpp</file> + <file>item.cpp</file> +</qresource> +</RCC> diff --git a/Tests/QtAutogen/sameName/bbb/aaa/item.cpp b/Tests/QtAutogen/sameName/bbb/aaa/item.cpp new file mode 100644 index 0000000..ac4b2c2 --- /dev/null +++ b/Tests/QtAutogen/sameName/bbb/aaa/item.cpp @@ -0,0 +1,10 @@ +#include "item.hpp" + +namespace bbb { +namespace aaa { + +void Item::go() +{ +} +} +} diff --git a/Tests/QtAutogen/sameName/bbb/aaa/item.hpp b/Tests/QtAutogen/sameName/bbb/aaa/item.hpp new file mode 100644 index 0000000..be07ca8 --- /dev/null +++ b/Tests/QtAutogen/sameName/bbb/aaa/item.hpp @@ -0,0 +1,18 @@ +#ifndef BBB_AAA_ITEM_HPP +#define BBB_AAA_ITEM_HPP + +#include <QObject> + +namespace bbb { +namespace aaa { + +class Item : public QObject +{ + Q_OBJECT + Q_SLOT + void go(); +}; +} +} + +#endif diff --git a/Tests/QtAutogen/sameName/bbb/data.qrc b/Tests/QtAutogen/sameName/bbb/data.qrc new file mode 100644 index 0000000..5b080f5 --- /dev/null +++ b/Tests/QtAutogen/sameName/bbb/data.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="bbb/"> + <file>item.hpp</file> + <file>item.cpp</file> +</qresource> +</RCC> diff --git a/Tests/QtAutogen/sameName/bbb/item.cpp b/Tests/QtAutogen/sameName/bbb/item.cpp new file mode 100644 index 0000000..f97a143 --- /dev/null +++ b/Tests/QtAutogen/sameName/bbb/item.cpp @@ -0,0 +1,8 @@ +#include "item.hpp" + +namespace bbb { + +void Item::go() +{ +} +} diff --git a/Tests/QtAutogen/sameName/bbb/item.hpp b/Tests/QtAutogen/sameName/bbb/item.hpp new file mode 100644 index 0000000..5b7f985 --- /dev/null +++ b/Tests/QtAutogen/sameName/bbb/item.hpp @@ -0,0 +1,16 @@ +#ifndef BBB_ITEM_HPP +#define BBB_ITEM_HPP + +#include <QObject> + +namespace bbb { + +class Item : public QObject +{ + Q_OBJECT + Q_SLOT + void go(); +}; +} + +#endif diff --git a/Tests/QtAutogen/sameName/ccc/data.qrc b/Tests/QtAutogen/sameName/ccc/data.qrc new file mode 100644 index 0000000..f934c39 --- /dev/null +++ b/Tests/QtAutogen/sameName/ccc/data.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="ccc/"> + <file>item.hpp</file> + <file>item.cpp</file> +</qresource> +</RCC> diff --git a/Tests/QtAutogen/sameName/ccc/item.cpp b/Tests/QtAutogen/sameName/ccc/item.cpp new file mode 100644 index 0000000..d90b2b8 --- /dev/null +++ b/Tests/QtAutogen/sameName/ccc/item.cpp @@ -0,0 +1,23 @@ +#include "item.hpp" + +namespace ccc { + +void Item::go() +{ +} + +class MocTest : public QObject +{ + Q_OBJECT; + Q_SLOT + void go(); +}; + +void MocTest::go() +{ +} +} + +// Include own moc files +#include "item.moc" +#include "moc_item.cpp" diff --git a/Tests/QtAutogen/sameName/ccc/item.hpp b/Tests/QtAutogen/sameName/ccc/item.hpp new file mode 100644 index 0000000..96fcc24 --- /dev/null +++ b/Tests/QtAutogen/sameName/ccc/item.hpp @@ -0,0 +1,16 @@ +#ifndef CCC_ITEM_HPP +#define CCC_ITEM_HPP + +#include <QObject> + +namespace ccc { + +class Item : public QObject +{ + Q_OBJECT + Q_SLOT + void go(); +}; +} + +#endif diff --git a/Tests/QtAutogen/sameName/data.qrc b/Tests/QtAutogen/sameName/data.qrc new file mode 100644 index 0000000..4ce0b4e --- /dev/null +++ b/Tests/QtAutogen/sameName/data.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>main.cpp</file> +</qresource> +</RCC> diff --git a/Tests/QtAutogen/sameName/item.cpp b/Tests/QtAutogen/sameName/item.cpp new file mode 100644 index 0000000..e013cf3 --- /dev/null +++ b/Tests/QtAutogen/sameName/item.cpp @@ -0,0 +1,5 @@ +#include "item.hpp" + +void Item::go() +{ +} diff --git a/Tests/QtAutogen/sameName/item.hpp b/Tests/QtAutogen/sameName/item.hpp new file mode 100644 index 0000000..91bba3b --- /dev/null +++ b/Tests/QtAutogen/sameName/item.hpp @@ -0,0 +1,13 @@ +#ifndef ITEM_HPP +#define ITEM_HPP + +#include <QObject> + +class Item : public QObject +{ + Q_OBJECT + Q_SLOT + void go(); +}; + +#endif diff --git a/Tests/QtAutogen/sameName/main.cpp b/Tests/QtAutogen/sameName/main.cpp new file mode 100644 index 0000000..a4ffcb3 --- /dev/null +++ b/Tests/QtAutogen/sameName/main.cpp @@ -0,0 +1,16 @@ +#include "aaa/bbb/item.hpp" +#include "aaa/item.hpp" +#include "bbb/aaa/item.hpp" +#include "bbb/item.hpp" +#include "ccc/item.hpp" + +int main(int argv, char** args) +{ + // Object instances + ::aaa::Item aaa_item; + ::aaa::bbb::Item aaa_bbb_item; + ::bbb::Item bbb_item; + ::bbb::aaa::Item bbb_aaa_item; + ::ccc::Item ccc_item; + return 0; +} |