mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-06 04:03:27 +03:00
Autogen: Tests: Add test for STATIC_LIBRARY cycles
This commit is contained in:
1 parent
798e4f2fad
commit
3a4db8617e
9 files changed
+89
No files matched your search
@@ -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)
|
||||
@@ -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)
|
||||
@@ -0,0 +1,7 @@
|
||||
#include "a.h"
|
||||
#include "b.h"
|
||||
|
||||
A::A()
|
||||
{
|
||||
B b;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef CLASSA_HPP
|
||||
#define CLASSA_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class A : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
A();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
#include "b.h"
|
||||
#include "c.h"
|
||||
|
||||
B::B()
|
||||
{
|
||||
C c;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef CLASSB_HPP
|
||||
#define CLASSB_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class B : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
B();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
#include "c.h"
|
||||
#include "a.h"
|
||||
|
||||
C::C()
|
||||
{
|
||||
A a;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef CLASSC_HPP
|
||||
#define CLASSC_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class C : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
C();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
#include "a.h"
|
||||
|
||||
int main(int argv, char** args)
|
||||
{
|
||||
// Object instances
|
||||
A a;
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user