Autogen: Tests: Add test for STATIC_LIBRARY cycles

This commit is contained in:
Sebastian Holtermann 2017-10-25 18:24:42 +02:00 committed by Brad King
parent 798e4f2fad
commit 3a4db8617e
9 changed files with 89 additions and 0 deletions

View File

@ -213,6 +213,10 @@ add_subdirectory(objectLibrary)
# Source files with the same basename in different subdirectories
add_subdirectory(sameName)
# -- Test
# Tests static library cycles
add_subdirectory(staticLibraryCycle)
# -- Test
# Complex test case
add_subdirectory(complex)

View File

@ -0,0 +1,17 @@
# Test AUTOMOC and AUTORCC on source files with the same name
# but in different subdirectories
set(CMAKE_AUTOMOC ON)
# Cyclic static libraries
add_library(slc_a STATIC a.cpp)
target_link_libraries(slc_a ${QT_LIBRARIES} slc_b)
add_library(slc_b STATIC b.cpp)
target_link_libraries(slc_b ${QT_LIBRARIES} slc_c)
add_library(slc_c STATIC c.cpp)
target_link_libraries(slc_c ${QT_LIBRARIES} slc_a)
add_executable(slc main.cpp)
target_link_libraries(slc ${QT_LIBRARIES} slc_a)

View File

@ -0,0 +1,7 @@
#include "a.h"
#include "b.h"
A::A()
{
B b;
}

View File

@ -0,0 +1,13 @@
#ifndef CLASSA_HPP
#define CLASSA_HPP
#include <QObject>
class A : public QObject
{
Q_OBJECT
public:
A();
};
#endif

View File

@ -0,0 +1,7 @@
#include "b.h"
#include "c.h"
B::B()
{
C c;
}

View File

@ -0,0 +1,13 @@
#ifndef CLASSB_HPP
#define CLASSB_HPP
#include <QObject>
class B : public QObject
{
Q_OBJECT
public:
B();
};
#endif

View File

@ -0,0 +1,7 @@
#include "c.h"
#include "a.h"
C::C()
{
A a;
}

View File

@ -0,0 +1,13 @@
#ifndef CLASSC_HPP
#define CLASSC_HPP
#include <QObject>
class C : public QObject
{
Q_OBJECT
public:
C();
};
#endif

View File

@ -0,0 +1,8 @@
#include "a.h"
int main(int argv, char** args)
{
// Object instances
A a;
return 0;
}