diff options
Diffstat (limited to 'Tests')
24 files changed, 17 insertions, 227 deletions
diff --git a/Tests/AliasTarget/CMakeLists.txt b/Tests/AliasTarget/CMakeLists.txt index 47ccbdc..552c83c 100644 --- a/Tests/AliasTarget/CMakeLists.txt +++ b/Tests/AliasTarget/CMakeLists.txt @@ -66,6 +66,11 @@ endif() add_library(iface INTERFACE) add_library(Alias::Iface ALIAS iface) +get_property(_aliased_target_set TARGET foo PROPERTY ALIASED_TARGET SET) +if(_aliased_target_set) + message(SEND_ERROR "ALIASED_TARGET is set for target foo") +endif() + get_target_property(_notAlias1 foo ALIASED_TARGET) if (NOT DEFINED _notAlias1) message(SEND_ERROR "_notAlias1 is not defined") @@ -78,12 +83,6 @@ if (NOT _notAlias1 STREQUAL _notAlias1-NOTFOUND) endif() get_property(_notAlias2 TARGET foo PROPERTY ALIASED_TARGET) -if (NOT DEFINED _notAlias2) - message(SEND_ERROR "_notAlias2 is not defined") -endif() if (_notAlias2) - message(SEND_ERROR "_notAlias2 is defined, but foo is not an ALIAS") -endif() -if (NOT _notAlias2 STREQUAL _notAlias2-NOTFOUND) - message(SEND_ERROR "_notAlias2 not defined to a -NOTFOUND variant") + message(SEND_ERROR "_notAlias2 evaluates to true, but foo is not an ALIAS") endif() diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 4875165..d5aca55 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -110,10 +110,6 @@ set_target_properties( AUTOMOC TRUE ) -# Test AUTOMOC and AUTORCC on source files with the same name -# but in different subdirectories -add_subdirectory(same_name) - 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/same_name/CMakeLists.txt b/Tests/QtAutogen/same_name/CMakeLists.txt deleted file mode 100644 index 54bf048..0000000 --- a/Tests/QtAutogen/same_name/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# Test AUTOMOC and AUTORCC on source files with the same name -# but in different subdirectories - -add_executable(same_name - 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 - main.cpp - data.qrc -) -target_include_directories(same_name PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries(same_name ${QT_LIBRARIES}) -set_target_properties( same_name PROPERTIES AUTOMOC TRUE AUTORCC TRUE ) diff --git a/Tests/QtAutogen/same_name/aaa/bbb/data.qrc b/Tests/QtAutogen/same_name/aaa/bbb/data.qrc deleted file mode 100644 index 0ea3537..0000000 --- a/Tests/QtAutogen/same_name/aaa/bbb/data.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<!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/same_name/aaa/bbb/item.cpp b/Tests/QtAutogen/same_name/aaa/bbb/item.cpp deleted file mode 100644 index 20d0044..0000000 --- a/Tests/QtAutogen/same_name/aaa/bbb/item.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "item.hpp" - -namespace aaa { -namespace bbb { - -void Item::go() -{ -} -} -} diff --git a/Tests/QtAutogen/same_name/aaa/bbb/item.hpp b/Tests/QtAutogen/same_name/aaa/bbb/item.hpp deleted file mode 100644 index 87ac6ea..0000000 --- a/Tests/QtAutogen/same_name/aaa/bbb/item.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef SDA_SDB_ITEM_HPP -#define SDA_SDB_ITEM_HPP - -#include <QObject> - -namespace aaa { -namespace bbb { - -class Item : public QObject -{ - Q_OBJECT - Q_SLOT - void go(); -}; -} -} - -#endif diff --git a/Tests/QtAutogen/same_name/aaa/data.qrc b/Tests/QtAutogen/same_name/aaa/data.qrc deleted file mode 100644 index 379af60..0000000 --- a/Tests/QtAutogen/same_name/aaa/data.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource prefix="aaa/"> - <file>item.hpp</file> - <file>item.cpp</file> -</qresource> -</RCC> diff --git a/Tests/QtAutogen/same_name/aaa/item.cpp b/Tests/QtAutogen/same_name/aaa/item.cpp deleted file mode 100644 index 95dd3b6..0000000 --- a/Tests/QtAutogen/same_name/aaa/item.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "item.hpp" - -namespace aaa { - -void Item::go() -{ -} -} diff --git a/Tests/QtAutogen/same_name/aaa/item.hpp b/Tests/QtAutogen/same_name/aaa/item.hpp deleted file mode 100644 index 68476ce..0000000 --- a/Tests/QtAutogen/same_name/aaa/item.hpp +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef SDA_ITEM_HPP -#define SDA_ITEM_HPP - -#include <QObject> - -namespace aaa { - -class Item : public QObject -{ - Q_OBJECT - Q_SLOT - void go(); -}; -} - -#endif diff --git a/Tests/QtAutogen/same_name/bbb/aaa/data.qrc b/Tests/QtAutogen/same_name/bbb/aaa/data.qrc deleted file mode 100644 index da98009..0000000 --- a/Tests/QtAutogen/same_name/bbb/aaa/data.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<!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/same_name/bbb/aaa/item.cpp b/Tests/QtAutogen/same_name/bbb/aaa/item.cpp deleted file mode 100644 index ac4b2c2..0000000 --- a/Tests/QtAutogen/same_name/bbb/aaa/item.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "item.hpp" - -namespace bbb { -namespace aaa { - -void Item::go() -{ -} -} -} diff --git a/Tests/QtAutogen/same_name/bbb/aaa/item.hpp b/Tests/QtAutogen/same_name/bbb/aaa/item.hpp deleted file mode 100644 index 0a8e024..0000000 --- a/Tests/QtAutogen/same_name/bbb/aaa/item.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef SDB_SDA_ITEM_HPP -#define SDB_SDA_ITEM_HPP - -#include <QObject> - -namespace bbb { -namespace aaa { - -class Item : public QObject -{ - Q_OBJECT - Q_SLOT - void go(); -}; -} -} - -#endif diff --git a/Tests/QtAutogen/same_name/bbb/data.qrc b/Tests/QtAutogen/same_name/bbb/data.qrc deleted file mode 100644 index 5b080f5..0000000 --- a/Tests/QtAutogen/same_name/bbb/data.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource prefix="bbb/"> - <file>item.hpp</file> - <file>item.cpp</file> -</qresource> -</RCC> diff --git a/Tests/QtAutogen/same_name/bbb/item.cpp b/Tests/QtAutogen/same_name/bbb/item.cpp deleted file mode 100644 index f97a143..0000000 --- a/Tests/QtAutogen/same_name/bbb/item.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "item.hpp" - -namespace bbb { - -void Item::go() -{ -} -} diff --git a/Tests/QtAutogen/same_name/bbb/item.hpp b/Tests/QtAutogen/same_name/bbb/item.hpp deleted file mode 100644 index 3da5837..0000000 --- a/Tests/QtAutogen/same_name/bbb/item.hpp +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef SDB_ITEM_HPP -#define SDB_ITEM_HPP - -#include <QObject> - -namespace bbb { - -class Item : public QObject -{ - Q_OBJECT - Q_SLOT - void go(); -}; -} - -#endif diff --git a/Tests/QtAutogen/same_name/ccc/data.qrc b/Tests/QtAutogen/same_name/ccc/data.qrc deleted file mode 100644 index f934c39..0000000 --- a/Tests/QtAutogen/same_name/ccc/data.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource prefix="ccc/"> - <file>item.hpp</file> - <file>item.cpp</file> -</qresource> -</RCC> diff --git a/Tests/QtAutogen/same_name/ccc/item.cpp b/Tests/QtAutogen/same_name/ccc/item.cpp deleted file mode 100644 index d90b2b8..0000000 --- a/Tests/QtAutogen/same_name/ccc/item.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#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/same_name/ccc/item.hpp b/Tests/QtAutogen/same_name/ccc/item.hpp deleted file mode 100644 index c855936..0000000 --- a/Tests/QtAutogen/same_name/ccc/item.hpp +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef SDC_ITEM_HPP -#define SDC_ITEM_HPP - -#include <QObject> - -namespace ccc { - -class Item : public QObject -{ - Q_OBJECT - Q_SLOT - void go(); -}; -} - -#endif diff --git a/Tests/QtAutogen/same_name/data.qrc b/Tests/QtAutogen/same_name/data.qrc deleted file mode 100644 index 4ce0b4e..0000000 --- a/Tests/QtAutogen/same_name/data.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource> - <file>main.cpp</file> -</qresource> -</RCC> diff --git a/Tests/QtAutogen/same_name/main.cpp b/Tests/QtAutogen/same_name/main.cpp deleted file mode 100644 index a4ffcb3..0000000 --- a/Tests/QtAutogen/same_name/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#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; -} diff --git a/Tests/RunCMake/AutoExportDll/AutoExport.cmake b/Tests/RunCMake/AutoExportDll/AutoExport.cmake index bdddb38..d37e896 100644 --- a/Tests/RunCMake/AutoExportDll/AutoExport.cmake +++ b/Tests/RunCMake/AutoExportDll/AutoExport.cmake @@ -2,7 +2,9 @@ project(autoexport) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${autoexport_BINARY_DIR}/bin) add_subdirectory(sub) -add_library(autoexport SHARED hello.cxx world.cxx foo.c) +add_library(objlib OBJECT objlib.c) +set_property(TARGET objlib PROPERTY POSITION_INDEPENDENT_CODE 1) +add_library(autoexport SHARED hello.cxx world.cxx foo.c $<TARGET_OBJECTS:objlib>) add_executable(say say.cxx) if(MSVC) diff --git a/Tests/RunCMake/AutoExportDll/objlib.c b/Tests/RunCMake/AutoExportDll/objlib.c new file mode 100644 index 0000000..54a9658 --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/objlib.c @@ -0,0 +1,4 @@ +int objlib() +{ + return 7; +} diff --git a/Tests/RunCMake/AutoExportDll/say.cxx b/Tests/RunCMake/AutoExportDll/say.cxx index 9ca8d31..e966b1f 100644 --- a/Tests/RunCMake/AutoExportDll/say.cxx +++ b/Tests/RunCMake/AutoExportDll/say.cxx @@ -11,6 +11,7 @@ extern "C" { int WINAPI foo(); // test regular C int bar(); +int objlib(); } // test c++ functions @@ -39,6 +40,7 @@ int main() foo(); printf("\n"); bar(); + objlib(); printf("\n"); return 0; } diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index b6d1c38..dbd5530 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -309,7 +309,8 @@ endif() if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja") if(UNIX AND NOT CYGWIN) execute_process(COMMAND ldd --help - OUTPUT_VARIABLE LDD_HELP) + OUTPUT_VARIABLE LDD_HELP + ERROR_VARIABLE LDD_ERR) if("${LDD_HELP}" MATCHES "(-r, --function-relocs.*process data and function relocations.*-u, --unused.*print unused direct dependencies)") add_RunCMake_test(LinkWhatYouUse) |