summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogen
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/QtAutogen')
-rw-r--r--Tests/QtAutogen/CMakeLists.txt192
-rw-r--r--Tests/QtAutogen/automoc_rerun/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/autorcc_depends/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/complex/Adir/CMakeLists.txt (renamed from Tests/QtAutogen/Adir/CMakeLists.txt)0
-rw-r--r--Tests/QtAutogen/complex/Adir/libA.cpp (renamed from Tests/QtAutogen/Adir/libA.cpp)0
-rw-r--r--Tests/QtAutogen/complex/Adir/libA.h (renamed from Tests/QtAutogen/Adir/libA.h)0
-rw-r--r--Tests/QtAutogen/complex/Bdir/CMakeLists.txt (renamed from Tests/QtAutogen/Bdir/CMakeLists.txt)1
-rw-r--r--Tests/QtAutogen/complex/Bdir/libB.cpp (renamed from Tests/QtAutogen/Bdir/libB.cpp)0
-rw-r--r--Tests/QtAutogen/complex/Bdir/libB.h (renamed from Tests/QtAutogen/Bdir/libB.h)0
-rw-r--r--Tests/QtAutogen/complex/CMakeLists.txt82
-rw-r--r--Tests/QtAutogen/complex/abc.cpp (renamed from Tests/QtAutogen/abc.cpp)0
-rw-r--r--Tests/QtAutogen/complex/abc.h (renamed from Tests/QtAutogen/abc.h)0
-rw-r--r--Tests/QtAutogen/complex/abc_p.h (renamed from Tests/QtAutogen/abc_p.h)0
-rw-r--r--Tests/QtAutogen/complex/bar.cpp (renamed from Tests/QtAutogen/bar.cpp)0
-rw-r--r--Tests/QtAutogen/complex/blub.cpp (renamed from Tests/QtAutogen/blub.cpp)0
-rw-r--r--Tests/QtAutogen/complex/blub.h (renamed from Tests/QtAutogen/blub.h)0
-rw-r--r--Tests/QtAutogen/complex/calwidget.cpp (renamed from Tests/QtAutogen/calwidget.cpp)0
-rw-r--r--Tests/QtAutogen/complex/calwidget.h (renamed from Tests/QtAutogen/calwidget.h)0
-rw-r--r--Tests/QtAutogen/complex/calwidget.ui (renamed from Tests/QtAutogen/calwidget.ui)0
-rw-r--r--Tests/QtAutogen/complex/codeeditor.cpp (renamed from Tests/QtAutogen/codeeditor.cpp)0
-rw-r--r--Tests/QtAutogen/complex/codeeditor.h (renamed from Tests/QtAutogen/codeeditor.h)0
-rw-r--r--Tests/QtAutogen/complex/debug_class.cpp (renamed from Tests/QtAutogen/debug_class.cpp)0
-rw-r--r--Tests/QtAutogen/complex/debug_class.h (renamed from Tests/QtAutogen/debug_class.h)0
-rw-r--r--Tests/QtAutogen/complex/debug_class.ui (renamed from Tests/QtAutogen/debug_class.ui)0
-rw-r--r--Tests/QtAutogen/complex/debug_resource.qrc (renamed from Tests/QtAutogen/debug_resource.qrc)0
-rw-r--r--Tests/QtAutogen/complex/foo.cpp (renamed from Tests/QtAutogen/foo.cpp)0
-rw-r--r--Tests/QtAutogen/complex/foo.h (renamed from Tests/QtAutogen/foo.h)0
-rw-r--r--Tests/QtAutogen/complex/gadget.cpp (renamed from Tests/QtAutogen/gadget.cpp)0
-rw-r--r--Tests/QtAutogen/complex/gadget.h (renamed from Tests/QtAutogen/gadget.h)0
-rw-r--r--Tests/QtAutogen/complex/generated.cpp (renamed from Tests/QtAutogen/generated.cpp)0
-rw-r--r--Tests/QtAutogen/complex/generated.h (renamed from Tests/QtAutogen/generated.h)0
-rw-r--r--Tests/QtAutogen/complex/generated.txt.in (renamed from Tests/QtAutogen/generated.txt.in)0
-rw-r--r--Tests/QtAutogen/complex/generated_resource.qrc.in (renamed from Tests/QtAutogen/generated_resource.qrc.in)0
-rw-r--r--Tests/QtAutogen/complex/libC.cpp (renamed from Tests/QtAutogen/libC.cpp)0
-rw-r--r--Tests/QtAutogen/complex/libC.h (renamed from Tests/QtAutogen/libC.h)0
-rw-r--r--Tests/QtAutogen/complex/main.cpp (renamed from Tests/QtAutogen/main.cpp)0
-rw-r--r--Tests/QtAutogen/complex/multiplewidgets.cpp (renamed from Tests/QtAutogen/multiplewidgets.cpp)0
-rw-r--r--Tests/QtAutogen/complex/multiplewidgets.h (renamed from Tests/QtAutogen/multiplewidgets.h)0
-rw-r--r--Tests/QtAutogen/complex/myinterface.h.in (renamed from Tests/QtAutogen/myinterface.h.in)0
-rw-r--r--Tests/QtAutogen/complex/myotherinterface.h.in (renamed from Tests/QtAutogen/myotherinterface.h.in)0
-rw-r--r--Tests/QtAutogen/complex/private_slot.cpp (renamed from Tests/QtAutogen/private_slot.cpp)0
-rw-r--r--Tests/QtAutogen/complex/private_slot.h (renamed from Tests/QtAutogen/private_slot.h)0
-rw-r--r--Tests/QtAutogen/complex/resourcetester.cpp (renamed from Tests/QtAutogen/resourcetester.cpp)0
-rw-r--r--Tests/QtAutogen/complex/resourcetester.h (renamed from Tests/QtAutogen/resourcetester.h)0
-rw-r--r--Tests/QtAutogen/complex/second_resource.qrc (renamed from Tests/QtAutogen/second_resource.qrc)0
-rw-r--r--Tests/QtAutogen/complex/second_widget.cpp (renamed from Tests/QtAutogen/second_widget.cpp)0
-rw-r--r--Tests/QtAutogen/complex/second_widget.h (renamed from Tests/QtAutogen/second_widget.h)0
-rw-r--r--Tests/QtAutogen/complex/second_widget.ui (renamed from Tests/QtAutogen/second_widget.ui)0
-rw-r--r--Tests/QtAutogen/complex/sub/bar.h (renamed from Tests/QtAutogen/sub/bar.h)0
-rw-r--r--Tests/QtAutogen/complex/targetObjectsTest.cpp (renamed from Tests/QtAutogen/targetObjectsTest.cpp)0
-rw-r--r--Tests/QtAutogen/complex/test.qrc (renamed from Tests/QtAutogen/test.qrc)0
-rw-r--r--Tests/QtAutogen/complex/widget1.ui (renamed from Tests/QtAutogen/widget1.ui)0
-rw-r--r--Tests/QtAutogen/complex/widget2.ui (renamed from Tests/QtAutogen/widget2.ui)0
-rw-r--r--Tests/QtAutogen/complex/xyz.cpp (renamed from Tests/QtAutogen/xyz.cpp)0
-rw-r--r--Tests/QtAutogen/complex/xyz.h (renamed from Tests/QtAutogen/xyz.h)0
-rw-r--r--Tests/QtAutogen/complex/yaf.cpp (renamed from Tests/QtAutogen/yaf.cpp)0
-rw-r--r--Tests/QtAutogen/complex/yaf.h (renamed from Tests/QtAutogen/yaf.h)0
-rw-r--r--Tests/QtAutogen/complex/yaf_p.h (renamed from Tests/QtAutogen/yaf_p.h)0
-rw-r--r--Tests/QtAutogen/defines_test/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/rccEmpty.cpp (renamed from Tests/QtAutogen/rcconly.cpp)4
-rw-r--r--Tests/QtAutogen/rccEmptyRes.qrc (renamed from Tests/QtAutogen/rcc_empty_resource.qrc)0
-rw-r--r--Tests/QtAutogen/rccOnly.cpp (renamed from Tests/QtAutogen/rcc_empty.cpp)4
-rw-r--r--Tests/QtAutogen/rccOnlyRes.qrc5
-rw-r--r--Tests/QtAutogen/sameName/CMakeLists.txt3
-rw-r--r--Tests/QtAutogen/skipMoc.cpp14
-rw-r--r--Tests/QtAutogen/skipRcc.cpp9
-rw-r--r--Tests/QtAutogen/skipSource/qItemA.cpp5
-rw-r--r--Tests/QtAutogen/skipSource/qItemA.hpp13
-rw-r--r--Tests/QtAutogen/skipSource/qItemB.cpp5
-rw-r--r--Tests/QtAutogen/skipSource/qItemB.hpp13
-rw-r--r--Tests/QtAutogen/skipSource/qItemC.cpp5
-rw-r--r--Tests/QtAutogen/skipSource/qItemC.hpp13
-rw-r--r--Tests/QtAutogen/skipSource/skipRccBad1.qrc5
-rw-r--r--Tests/QtAutogen/skipSource/skipRccBad2.qrc5
-rw-r--r--Tests/QtAutogen/skipSource/skipRccGood.qrc6
-rw-r--r--Tests/QtAutogen/skipSource/skipUicGen.cpp7
-rw-r--r--Tests/QtAutogen/skipSource/skipUicGen.hpp8
-rw-r--r--Tests/QtAutogen/skipSource/skipUicNoGen1.cpp7
-rw-r--r--Tests/QtAutogen/skipSource/skipUicNoGen1.hpp8
-rw-r--r--Tests/QtAutogen/skipSource/skipUicNoGen2.cpp7
-rw-r--r--Tests/QtAutogen/skipSource/skipUicNoGen2.hpp8
-rw-r--r--Tests/QtAutogen/skipSource/ui_nogen1.h6
-rw-r--r--Tests/QtAutogen/skipSource/ui_nogen2.h6
-rw-r--r--Tests/QtAutogen/skipSource/uigen1.ui24
-rw-r--r--Tests/QtAutogen/skipSource/uigen2.ui24
-rw-r--r--Tests/QtAutogen/skipUic.cpp22
-rw-r--r--Tests/QtAutogen/uicOnlySource/uiconly.cpp (renamed from Tests/QtAutogen/sub/uiconly.cpp)5
-rw-r--r--Tests/QtAutogen/uicOnlySource/uiconly.h (renamed from Tests/QtAutogen/sub/uiconly.h)4
-rw-r--r--Tests/QtAutogen/uicOnlySource/uiconly.ui (renamed from Tests/QtAutogen/sub/uiconly.ui)0
89 files changed, 418 insertions, 108 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index c713d1c..4b90ad8 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.7)
project(QtAutogen)
@@ -44,114 +44,44 @@ else()
endif()
-# -- RCC only
-add_executable(rcconly rcconly.cpp second_resource.qrc)
-set_property(TARGET rcconly PROPERTY AUTORCC ON)
-target_link_libraries(rcconly ${QT_QTCORE_TARGET})
+get_property(QT_COMPILE_FEATURES TARGET ${QT_QTCORE_TARGET} PROPERTY INTERFACE_COMPILE_FEATURES)
-# -- RCC empty
-add_executable(rcc_empty rcc_empty.cpp rcc_empty_resource.qrc)
-set_property(TARGET rcc_empty PROPERTY AUTORCC ON)
-target_link_libraries(rcc_empty ${QT_QTCORE_TARGET})
+# -- Test: AUTORCC
+# RCC only
+add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc)
+set_property(TARGET rccOnly PROPERTY AUTORCC ON)
+target_link_libraries(rccOnly ${QT_QTCORE_TARGET})
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
+# -- Test: AUTORCC
+# RCC empty
+add_executable(rccEmpty rccEmpty.cpp rccEmptyRes.qrc)
+set_property(TARGET rccEmpty PROPERTY AUTORCC ON)
+target_link_libraries(rccEmpty ${QT_QTCORE_TARGET})
-add_definitions(-DFOO -DSomeDefine="Barx")
-
-# enable relaxed mode so automoc can handle all the special cases:
-set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
-
-set(CMAKE_AUTOUIC ON)
-set(CMAKE_AUTORCC ON)
-
-# create an executable and two library targets, each requiring automoc:
-add_library(codeeditorLib STATIC codeeditor.cpp)
-
-add_library(privateSlot OBJECT private_slot.cpp)
-
-configure_file(generated_resource.qrc.in generated_resource.qrc @ONLY)
-add_custom_command(
- OUTPUT generated.txt
- COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/generated.txt.in" "${CMAKE_CURRENT_BINARY_DIR}/generated.txt"
- DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/generated.txt.in"
- )
-
-add_custom_target(generate_moc_input
- DEPENDS generated.txt
- COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}"
- COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h"
-)
-
-add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h"
- COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h"
- DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in"
-)
-
-if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_GENERATOR STREQUAL Ninja)
- set(debug_srcs "$<$<CONFIG:Debug>:debug_class.cpp>" $<$<CONFIG:Debug>:debug_resource.qrc>)
- set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:TEST_DEBUG_CLASS>)
-endif()
-
-# The -no-protection option disables the generation of include guards. Verify
-# that setting the source file property has an effect by using this and
-# issue an error in the preprocessor in calwidget.cpp if the include guard
-# is defined.
-set_source_files_properties(calwidget.ui PROPERTIES AUTOUIC_OPTIONS "-no-protection")
-
-add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
- multiplewidgets.cpp
- xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>
- test.qrc second_resource.qrc resourcetester.cpp generated.cpp ${debug_srcs}
- ${CMAKE_CURRENT_BINARY_DIR}/generated_resource.qrc
-)
-set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h")
-
-add_executable(targetObjectsTest targetObjectsTest.cpp $<TARGET_OBJECTS:privateSlot>)
-target_link_libraries(targetObjectsTest ${QT_LIBRARIES})
-
-set_target_properties(
- QtAutogen codeeditorLib privateSlot targetObjectsTest
- 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
-# test that CMAKE_AUTOMOC successfully reads the include directories
-# for the build interface from those targets. There has previously been
-# a bug where caching of the include directories happened before
-# extracting the includes to pass to moc.
-add_subdirectory(Bdir)
-add_subdirectory(Adir)
-add_library(libC SHARED libC.cpp)
-set_target_properties(libC PROPERTIES AUTOMOC TRUE)
-generate_export_header(libC)
-target_link_libraries(libC LINK_PUBLIC libB)
-
-target_link_libraries(QtAutogen codeeditorLib ${QT_LIBRARIES} libC)
+# -- Test: AUTOUIC
+# UIC only
+qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h)
+add_executable(uicOnly uicOnlySource/uiconly.cpp ${uicOnlyMoc})
+set_property(TARGET uicOnly PROPERTY AUTOUIC ON)
+target_link_libraries(uicOnly ${QT_LIBRARIES})
+# -- Test: AUTOMOC, AUTORCC
# Add not_generated_file.qrc to the source list to get the file-level
# dependency, but don't generate a c++ file from it. Disable the AUTORCC
# feature for this target. This tests that qrc files in the sources don't
# have an effect on generation if AUTORCC is off.
add_library(empty STATIC empty.cpp not_generated_file.qrc)
set_target_properties(empty PROPERTIES AUTORCC OFF)
-
set_target_properties(empty PROPERTIES AUTOMOC TRUE)
target_link_libraries(empty no_link_language)
add_library(no_link_language STATIC empty.h)
set_target_properties(no_link_language PROPERTIES AUTOMOC TRUE)
+# Pass Qt compiler features to targets that don't link against Qt
+target_compile_features(no_link_language PRIVATE ${QT_COMPILE_FEATURES})
+target_compile_features(empty PRIVATE ${QT_COMPILE_FEATURES})
-qtx_wrap_cpp(uicOnlyMoc sub/uiconly.h)
-add_executable(uiconly sub/uiconly.cpp ${uicOnlyMoc})
-target_link_libraries(uiconly ${QT_LIBRARIES})
-
+# -- Test: AUTORCC
+# When a file listed in a .qrc file changes the target must be rebuilt
try_compile(RCC_DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/autorcc_depends"
"${CMAKE_CURRENT_SOURCE_DIR}/autorcc_depends"
@@ -185,7 +115,8 @@ if (NOT file1_step1 GREATER file1_before)
message(SEND_ERROR "file1 (${qrc_file1}) should have changed in the first step!")
endif()
-#-----------------------------------------------------------------------------
+# -- Test: AUTOMOC
+# Ensure a repeated build succeeds when a header containing a QObject changes
try_compile(MOC_RERUN
"${CMAKE_CURRENT_BINARY_DIR}/automoc_rerun"
"${CMAKE_CURRENT_SOURCE_DIR}/automoc_rerun"
@@ -207,3 +138,74 @@ execute_process(COMMAND "${CMAKE_COMMAND}" --build .
if (automoc_rerun_result)
message(SEND_ERROR "Second build of automoc_rerun failed.")
endif()
+
+# -- Test: AUTOMOC, SKIP_AUTOMOC
+# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target
+qtx_wrap_cpp(skipMocWrapMoc
+ skipSource/qItemA.hpp
+ skipSource/qItemB.hpp)
+set(skipMocSources
+ skipMoc.cpp
+ skipSource/qItemA.cpp
+ skipSource/qItemB.cpp
+ skipSource/qItemC.cpp)
+set_property(SOURCE skipSource/qItemA.cpp PROPERTY SKIP_AUTOMOC ON)
+set_property(SOURCE skipSource/qItemB.cpp PROPERTY SKIP_AUTOGEN ON)
+# AUTOMOC enabled only
+add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc})
+set_property(TARGET skipMocA PROPERTY AUTOMOC ON)
+target_link_libraries(skipMocA ${QT_LIBRARIES})
+# AUTOMOC and AUTOUIC enabled
+add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc})
+set_property(TARGET skipMocB PROPERTY AUTOMOC ON)
+set_property(TARGET skipMocB PROPERTY AUTOUIC ON)
+target_link_libraries(skipMocB ${QT_LIBRARIES})
+
+# -- Test: AUTOUIC, SKIP_AUTOUIC
+# Test for SKIP_AUTOUIC and SKIP_AUTOGEN on an AUTOUIC enabled target
+set(skipUicSources
+ skipUic.cpp
+ skipSource/skipUicGen.cpp
+ skipSource/skipUicNoGen1.cpp
+ skipSource/skipUicNoGen2.cpp
+)
+set_property(SOURCE skipSource/skipUicNoGen1.cpp PROPERTY SKIP_AUTOUIC ON)
+set_property(SOURCE skipSource/skipUicNoGen2.cpp PROPERTY SKIP_AUTOGEN ON)
+# AUTOUIC enabled
+add_executable(skipUicA ${skipUicSources})
+set_property(TARGET skipUicA PROPERTY AUTOUIC ON)
+target_link_libraries(skipUicA ${QT_LIBRARIES})
+# AUTOUIC and AUTOMOC enabled
+add_executable(skipUicB ${skipUicSources})
+set_property(TARGET skipUicB PROPERTY AUTOUIC ON)
+set_property(TARGET skipUicB PROPERTY AUTOMOC ON)
+target_link_libraries(skipUicB ${QT_LIBRARIES})
+
+# -- Test: AUTORCC, SKIP_AUTORCC
+# Test for SKIP_AUTORCC and SKIP_AUTOGEN on an AUTORCC enabled target
+set(skipRccSources
+ skipRcc.cpp
+ skipSource/skipRccBad1.qrc
+ skipSource/skipRccBad2.qrc
+ skipSource/skipRccGood.qrc
+)
+set_property(SOURCE skipSource/skipRccBad1.qrc PROPERTY SKIP_AUTORCC ON)
+set_property(SOURCE skipSource/skipRccBad2.qrc PROPERTY SKIP_AUTOGEN ON)
+# AUTORCC enabled
+add_executable(skipRccA ${skipRccSources})
+set_property(TARGET skipRccA PROPERTY AUTORCC ON)
+target_link_libraries(skipRccA ${QT_LIBRARIES})
+# AUTORCC, AUTOUIC and AUTOMOC enabled
+add_executable(skipRccB ${skipRccSources})
+set_property(TARGET skipRccB PROPERTY AUTORCC ON)
+set_property(TARGET skipRccB PROPERTY AUTOUIC ON)
+set_property(TARGET skipRccB PROPERTY AUTOMOC ON)
+target_link_libraries(skipRccB ${QT_LIBRARIES})
+
+# -- Test: AUTOMOC AUTORCC
+# Source files with the same basename in different subdirectories
+add_subdirectory(sameName)
+
+# -- Test: AUTOMOC AUTORCC AUTOUIC
+# Complex test case
+add_subdirectory(complex)
diff --git a/Tests/QtAutogen/automoc_rerun/CMakeLists.txt b/Tests/QtAutogen/automoc_rerun/CMakeLists.txt
index 17bc332..92a682b 100644
--- a/Tests/QtAutogen/automoc_rerun/CMakeLists.txt
+++ b/Tests/QtAutogen/automoc_rerun/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.7)
project(automoc_rerun CXX)
if (QT_TEST_VERSION STREQUAL 4)
diff --git a/Tests/QtAutogen/autorcc_depends/CMakeLists.txt b/Tests/QtAutogen/autorcc_depends/CMakeLists.txt
index fbe71ad..7b51e11 100644
--- a/Tests/QtAutogen/autorcc_depends/CMakeLists.txt
+++ b/Tests/QtAutogen/autorcc_depends/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.7)
project(autorcc_depends)
set(CMAKE_AUTORCC ON)
diff --git a/Tests/QtAutogen/Adir/CMakeLists.txt b/Tests/QtAutogen/complex/Adir/CMakeLists.txt
index a1c36ff..a1c36ff 100644
--- a/Tests/QtAutogen/Adir/CMakeLists.txt
+++ b/Tests/QtAutogen/complex/Adir/CMakeLists.txt
diff --git a/Tests/QtAutogen/Adir/libA.cpp b/Tests/QtAutogen/complex/Adir/libA.cpp
index f79f24a..f79f24a 100644
--- a/Tests/QtAutogen/Adir/libA.cpp
+++ b/Tests/QtAutogen/complex/Adir/libA.cpp
diff --git a/Tests/QtAutogen/Adir/libA.h b/Tests/QtAutogen/complex/Adir/libA.h
index c4eb9f7..c4eb9f7 100644
--- a/Tests/QtAutogen/Adir/libA.h
+++ b/Tests/QtAutogen/complex/Adir/libA.h
diff --git a/Tests/QtAutogen/Bdir/CMakeLists.txt b/Tests/QtAutogen/complex/Bdir/CMakeLists.txt
index d9d4aa7..d338763 100644
--- a/Tests/QtAutogen/Bdir/CMakeLists.txt
+++ b/Tests/QtAutogen/complex/Bdir/CMakeLists.txt
@@ -6,5 +6,4 @@ set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
add_library(libB SHARED libB.cpp)
generate_export_header(libB)
-# set_property(TARGET libB APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
target_link_libraries(libB LINK_PUBLIC libA)
diff --git a/Tests/QtAutogen/Bdir/libB.cpp b/Tests/QtAutogen/complex/Bdir/libB.cpp
index d3b6753..d3b6753 100644
--- a/Tests/QtAutogen/Bdir/libB.cpp
+++ b/Tests/QtAutogen/complex/Bdir/libB.cpp
diff --git a/Tests/QtAutogen/Bdir/libB.h b/Tests/QtAutogen/complex/Bdir/libB.h
index e4ab788..e4ab788 100644
--- a/Tests/QtAutogen/Bdir/libB.h
+++ b/Tests/QtAutogen/complex/Bdir/libB.h
diff --git a/Tests/QtAutogen/complex/CMakeLists.txt b/Tests/QtAutogen/complex/CMakeLists.txt
new file mode 100644
index 0000000..d48f6cc
--- /dev/null
+++ b/Tests/QtAutogen/complex/CMakeLists.txt
@@ -0,0 +1,82 @@
+cmake_minimum_required(VERSION 3.7)
+
+# -- Test: AUTOMOC AUTORCC AUTOUIC
+add_definitions(-DFOO -DSomeDefine="Barx")
+
+# enable relaxed mode so automoc can handle all the special cases:
+set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
+set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTORCC ON)
+
+# create an executable and two library targets, each requiring automoc:
+add_library(codeeditorLib STATIC codeeditor.cpp)
+add_library(privateSlot OBJECT private_slot.cpp)
+# Pass Qt compiler features to targets that don't link against Qt
+target_compile_features(codeeditorLib PRIVATE ${QT_COMPILE_FEATURES})
+target_compile_features(privateSlot PRIVATE ${QT_COMPILE_FEATURES})
+
+configure_file(generated_resource.qrc.in generated_resource.qrc @ONLY)
+add_custom_command(
+ OUTPUT generated.txt
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/generated.txt.in" "${CMAKE_CURRENT_BINARY_DIR}/generated.txt"
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/generated.txt.in"
+ )
+
+add_custom_target(generate_moc_input
+ DEPENDS generated.txt
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}"
+ COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h"
+)
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h"
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in"
+)
+
+if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_GENERATOR STREQUAL Ninja)
+ set(debug_srcs "$<$<CONFIG:Debug>:debug_class.cpp>" $<$<CONFIG:Debug>:debug_resource.qrc>)
+ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:TEST_DEBUG_CLASS>)
+endif()
+
+# The -no-protection option disables the generation of include guards. Verify
+# that setting the source file property has an effect by using this and
+# issue an error in the preprocessor in calwidget.cpp if the include guard
+# is defined.
+set_source_files_properties(calwidget.ui PROPERTIES AUTOUIC_OPTIONS "-no-protection")
+
+add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
+ multiplewidgets.cpp
+ xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>
+ test.qrc second_resource.qrc resourcetester.cpp generated.cpp ${debug_srcs}
+ ${CMAKE_CURRENT_BINARY_DIR}/generated_resource.qrc
+)
+set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h")
+
+add_executable(targetObjectsTest targetObjectsTest.cpp $<TARGET_OBJECTS:privateSlot>)
+target_link_libraries(targetObjectsTest ${QT_LIBRARIES})
+
+set_target_properties(
+ QtAutogen codeeditorLib privateSlot targetObjectsTest
+ PROPERTIES
+ AUTOMOC TRUE
+)
+
+
+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
+# test that CMAKE_AUTOMOC successfully reads the include directories
+# for the build interface from those targets. There has previously been
+# a bug where caching of the include directories happened before
+# extracting the includes to pass to moc.
+add_subdirectory(Bdir)
+add_subdirectory(Adir)
+add_library(libC SHARED libC.cpp)
+set_target_properties(libC PROPERTIES AUTOMOC TRUE)
+generate_export_header(libC)
+target_link_libraries(libC LINK_PUBLIC libB)
+target_include_directories(libC PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+set_property(TARGET libC APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR} )
+
+target_link_libraries(QtAutogen codeeditorLib ${QT_LIBRARIES} libC)
diff --git a/Tests/QtAutogen/abc.cpp b/Tests/QtAutogen/complex/abc.cpp
index 2929b92..2929b92 100644
--- a/Tests/QtAutogen/abc.cpp
+++ b/Tests/QtAutogen/complex/abc.cpp
diff --git a/Tests/QtAutogen/abc.h b/Tests/QtAutogen/complex/abc.h
index ec5f411..ec5f411 100644
--- a/Tests/QtAutogen/abc.h
+++ b/Tests/QtAutogen/complex/abc.h
diff --git a/Tests/QtAutogen/abc_p.h b/Tests/QtAutogen/complex/abc_p.h
index be98487..be98487 100644
--- a/Tests/QtAutogen/abc_p.h
+++ b/Tests/QtAutogen/complex/abc_p.h
diff --git a/Tests/QtAutogen/bar.cpp b/Tests/QtAutogen/complex/bar.cpp
index 734bd7a..734bd7a 100644
--- a/Tests/QtAutogen/bar.cpp
+++ b/Tests/QtAutogen/complex/bar.cpp
diff --git a/Tests/QtAutogen/blub.cpp b/Tests/QtAutogen/complex/blub.cpp
index 1c497e0..1c497e0 100644
--- a/Tests/QtAutogen/blub.cpp
+++ b/Tests/QtAutogen/complex/blub.cpp
diff --git a/Tests/QtAutogen/blub.h b/Tests/QtAutogen/complex/blub.h
index ff79878..ff79878 100644
--- a/Tests/QtAutogen/blub.h
+++ b/Tests/QtAutogen/complex/blub.h
diff --git a/Tests/QtAutogen/calwidget.cpp b/Tests/QtAutogen/complex/calwidget.cpp
index 380e982..380e982 100644
--- a/Tests/QtAutogen/calwidget.cpp
+++ b/Tests/QtAutogen/complex/calwidget.cpp
diff --git a/Tests/QtAutogen/calwidget.h b/Tests/QtAutogen/complex/calwidget.h
index 084d959..084d959 100644
--- a/Tests/QtAutogen/calwidget.h
+++ b/Tests/QtAutogen/complex/calwidget.h
diff --git a/Tests/QtAutogen/calwidget.ui b/Tests/QtAutogen/complex/calwidget.ui
index 1c245ca..1c245ca 100644
--- a/Tests/QtAutogen/calwidget.ui
+++ b/Tests/QtAutogen/complex/calwidget.ui
diff --git a/Tests/QtAutogen/codeeditor.cpp b/Tests/QtAutogen/complex/codeeditor.cpp
index 0caf8a7..0caf8a7 100644
--- a/Tests/QtAutogen/codeeditor.cpp
+++ b/Tests/QtAutogen/complex/codeeditor.cpp
diff --git a/Tests/QtAutogen/codeeditor.h b/Tests/QtAutogen/complex/codeeditor.h
index b410bd4..b410bd4 100644
--- a/Tests/QtAutogen/codeeditor.h
+++ b/Tests/QtAutogen/complex/codeeditor.h
diff --git a/Tests/QtAutogen/debug_class.cpp b/Tests/QtAutogen/complex/debug_class.cpp
index 46b09e7..46b09e7 100644
--- a/Tests/QtAutogen/debug_class.cpp
+++ b/Tests/QtAutogen/complex/debug_class.cpp
diff --git a/Tests/QtAutogen/debug_class.h b/Tests/QtAutogen/complex/debug_class.h
index c02f0ed..c02f0ed 100644
--- a/Tests/QtAutogen/debug_class.h
+++ b/Tests/QtAutogen/complex/debug_class.h
diff --git a/Tests/QtAutogen/debug_class.ui b/Tests/QtAutogen/complex/debug_class.ui
index dc2e1ac..dc2e1ac 100644
--- a/Tests/QtAutogen/debug_class.ui
+++ b/Tests/QtAutogen/complex/debug_class.ui
diff --git a/Tests/QtAutogen/debug_resource.qrc b/Tests/QtAutogen/complex/debug_resource.qrc
index db98b9b..db98b9b 100644
--- a/Tests/QtAutogen/debug_resource.qrc
+++ b/Tests/QtAutogen/complex/debug_resource.qrc
diff --git a/Tests/QtAutogen/foo.cpp b/Tests/QtAutogen/complex/foo.cpp
index f665eee..f665eee 100644
--- a/Tests/QtAutogen/foo.cpp
+++ b/Tests/QtAutogen/complex/foo.cpp
diff --git a/Tests/QtAutogen/foo.h b/Tests/QtAutogen/complex/foo.h
index 3e03fe6..3e03fe6 100644
--- a/Tests/QtAutogen/foo.h
+++ b/Tests/QtAutogen/complex/foo.h
diff --git a/Tests/QtAutogen/gadget.cpp b/Tests/QtAutogen/complex/gadget.cpp
index 23d95fa..23d95fa 100644
--- a/Tests/QtAutogen/gadget.cpp
+++ b/Tests/QtAutogen/complex/gadget.cpp
diff --git a/Tests/QtAutogen/gadget.h b/Tests/QtAutogen/complex/gadget.h
index 3253e31..3253e31 100644
--- a/Tests/QtAutogen/gadget.h
+++ b/Tests/QtAutogen/complex/gadget.h
diff --git a/Tests/QtAutogen/generated.cpp b/Tests/QtAutogen/complex/generated.cpp
index d514c61..d514c61 100644
--- a/Tests/QtAutogen/generated.cpp
+++ b/Tests/QtAutogen/complex/generated.cpp
diff --git a/Tests/QtAutogen/generated.h b/Tests/QtAutogen/complex/generated.h
index 62e1607..62e1607 100644
--- a/Tests/QtAutogen/generated.h
+++ b/Tests/QtAutogen/complex/generated.h
diff --git a/Tests/QtAutogen/generated.txt.in b/Tests/QtAutogen/complex/generated.txt.in
index 77507bb..77507bb 100644
--- a/Tests/QtAutogen/generated.txt.in
+++ b/Tests/QtAutogen/complex/generated.txt.in
diff --git a/Tests/QtAutogen/generated_resource.qrc.in b/Tests/QtAutogen/complex/generated_resource.qrc.in
index da5fa62..da5fa62 100644
--- a/Tests/QtAutogen/generated_resource.qrc.in
+++ b/Tests/QtAutogen/complex/generated_resource.qrc.in
diff --git a/Tests/QtAutogen/libC.cpp b/Tests/QtAutogen/complex/libC.cpp
index a3acff1..a3acff1 100644
--- a/Tests/QtAutogen/libC.cpp
+++ b/Tests/QtAutogen/complex/libC.cpp
diff --git a/Tests/QtAutogen/libC.h b/Tests/QtAutogen/complex/libC.h
index 3bc2bad..3bc2bad 100644
--- a/Tests/QtAutogen/libC.h
+++ b/Tests/QtAutogen/complex/libC.h
diff --git a/Tests/QtAutogen/main.cpp b/Tests/QtAutogen/complex/main.cpp
index d557c70..d557c70 100644
--- a/Tests/QtAutogen/main.cpp
+++ b/Tests/QtAutogen/complex/main.cpp
diff --git a/Tests/QtAutogen/multiplewidgets.cpp b/Tests/QtAutogen/complex/multiplewidgets.cpp
index fda36ea..fda36ea 100644
--- a/Tests/QtAutogen/multiplewidgets.cpp
+++ b/Tests/QtAutogen/complex/multiplewidgets.cpp
diff --git a/Tests/QtAutogen/multiplewidgets.h b/Tests/QtAutogen/complex/multiplewidgets.h
index a4d0a50..a4d0a50 100644
--- a/Tests/QtAutogen/multiplewidgets.h
+++ b/Tests/QtAutogen/complex/multiplewidgets.h
diff --git a/Tests/QtAutogen/myinterface.h.in b/Tests/QtAutogen/complex/myinterface.h.in
index c6c0ba1..c6c0ba1 100644
--- a/Tests/QtAutogen/myinterface.h.in
+++ b/Tests/QtAutogen/complex/myinterface.h.in
diff --git a/Tests/QtAutogen/myotherinterface.h.in b/Tests/QtAutogen/complex/myotherinterface.h.in
index d21e7af..d21e7af 100644
--- a/Tests/QtAutogen/myotherinterface.h.in
+++ b/Tests/QtAutogen/complex/myotherinterface.h.in
diff --git a/Tests/QtAutogen/private_slot.cpp b/Tests/QtAutogen/complex/private_slot.cpp
index ab1682a..ab1682a 100644
--- a/Tests/QtAutogen/private_slot.cpp
+++ b/Tests/QtAutogen/complex/private_slot.cpp
diff --git a/Tests/QtAutogen/private_slot.h b/Tests/QtAutogen/complex/private_slot.h
index 8041eb2..8041eb2 100644
--- a/Tests/QtAutogen/private_slot.h
+++ b/Tests/QtAutogen/complex/private_slot.h
diff --git a/Tests/QtAutogen/resourcetester.cpp b/Tests/QtAutogen/complex/resourcetester.cpp
index 4ecb6b4..4ecb6b4 100644
--- a/Tests/QtAutogen/resourcetester.cpp
+++ b/Tests/QtAutogen/complex/resourcetester.cpp
diff --git a/Tests/QtAutogen/resourcetester.h b/Tests/QtAutogen/complex/resourcetester.h
index dbdb3ad..dbdb3ad 100644
--- a/Tests/QtAutogen/resourcetester.h
+++ b/Tests/QtAutogen/complex/resourcetester.h
diff --git a/Tests/QtAutogen/second_resource.qrc b/Tests/QtAutogen/complex/second_resource.qrc
index 27bfb14..27bfb14 100644
--- a/Tests/QtAutogen/second_resource.qrc
+++ b/Tests/QtAutogen/complex/second_resource.qrc
diff --git a/Tests/QtAutogen/second_widget.cpp b/Tests/QtAutogen/complex/second_widget.cpp
index c575f10..c575f10 100644
--- a/Tests/QtAutogen/second_widget.cpp
+++ b/Tests/QtAutogen/complex/second_widget.cpp
diff --git a/Tests/QtAutogen/second_widget.h b/Tests/QtAutogen/complex/second_widget.h
index c7929c4..c7929c4 100644
--- a/Tests/QtAutogen/second_widget.h
+++ b/Tests/QtAutogen/complex/second_widget.h
diff --git a/Tests/QtAutogen/second_widget.ui b/Tests/QtAutogen/complex/second_widget.ui
index 4effa58..4effa58 100644
--- a/Tests/QtAutogen/second_widget.ui
+++ b/Tests/QtAutogen/complex/second_widget.ui
diff --git a/Tests/QtAutogen/sub/bar.h b/Tests/QtAutogen/complex/sub/bar.h
index e4093f6..e4093f6 100644
--- a/Tests/QtAutogen/sub/bar.h
+++ b/Tests/QtAutogen/complex/sub/bar.h
diff --git a/Tests/QtAutogen/targetObjectsTest.cpp b/Tests/QtAutogen/complex/targetObjectsTest.cpp
index 766b775..766b775 100644
--- a/Tests/QtAutogen/targetObjectsTest.cpp
+++ b/Tests/QtAutogen/complex/targetObjectsTest.cpp
diff --git a/Tests/QtAutogen/test.qrc b/Tests/QtAutogen/complex/test.qrc
index c3d4e3c..c3d4e3c 100644
--- a/Tests/QtAutogen/test.qrc
+++ b/Tests/QtAutogen/complex/test.qrc
diff --git a/Tests/QtAutogen/widget1.ui b/Tests/QtAutogen/complex/widget1.ui
index 8fce81a..8fce81a 100644
--- a/Tests/QtAutogen/widget1.ui
+++ b/Tests/QtAutogen/complex/widget1.ui
diff --git a/Tests/QtAutogen/widget2.ui b/Tests/QtAutogen/complex/widget2.ui
index 1f411b9..1f411b9 100644
--- a/Tests/QtAutogen/widget2.ui
+++ b/Tests/QtAutogen/complex/widget2.ui
diff --git a/Tests/QtAutogen/xyz.cpp b/Tests/QtAutogen/complex/xyz.cpp
index e46c9d3..e46c9d3 100644
--- a/Tests/QtAutogen/xyz.cpp
+++ b/Tests/QtAutogen/complex/xyz.cpp
diff --git a/Tests/QtAutogen/xyz.h b/Tests/QtAutogen/complex/xyz.h
index 8b813fd..8b813fd 100644
--- a/Tests/QtAutogen/xyz.h
+++ b/Tests/QtAutogen/complex/xyz.h
diff --git a/Tests/QtAutogen/yaf.cpp b/Tests/QtAutogen/complex/yaf.cpp
index 70e26aa..70e26aa 100644
--- a/Tests/QtAutogen/yaf.cpp
+++ b/Tests/QtAutogen/complex/yaf.cpp
diff --git a/Tests/QtAutogen/yaf.h b/Tests/QtAutogen/complex/yaf.h
index f271061..f271061 100644
--- a/Tests/QtAutogen/yaf.h
+++ b/Tests/QtAutogen/complex/yaf.h
diff --git a/Tests/QtAutogen/yaf_p.h b/Tests/QtAutogen/complex/yaf_p.h
index ea5eed6..ea5eed6 100644
--- a/Tests/QtAutogen/yaf_p.h
+++ b/Tests/QtAutogen/complex/yaf_p.h
diff --git a/Tests/QtAutogen/defines_test/CMakeLists.txt b/Tests/QtAutogen/defines_test/CMakeLists.txt
index ad4e684..9ee9a22 100644
--- a/Tests/QtAutogen/defines_test/CMakeLists.txt
+++ b/Tests/QtAutogen/defines_test/CMakeLists.txt
@@ -1,6 +1,4 @@
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
-
add_executable(defines_test defines_test.cpp)
set_target_properties(defines_test PROPERTIES AUTOMOC TRUE)
target_link_libraries(defines_test Qt4::QtGui)
diff --git a/Tests/QtAutogen/rcconly.cpp b/Tests/QtAutogen/rccEmpty.cpp
index 854c4c1..7f2c527 100644
--- a/Tests/QtAutogen/rcconly.cpp
+++ b/Tests/QtAutogen/rccEmpty.cpp
@@ -1,9 +1,9 @@
-extern int qInitResources_second_resource();
+extern int qInitResources_rccEmptyRes();
int main(int, char**)
{
// Fails to link if the symbol is not present.
- qInitResources_second_resource();
+ qInitResources_rccEmptyRes();
return 0;
}
diff --git a/Tests/QtAutogen/rcc_empty_resource.qrc b/Tests/QtAutogen/rccEmptyRes.qrc
index 4ca9cd5..4ca9cd5 100644
--- a/Tests/QtAutogen/rcc_empty_resource.qrc
+++ b/Tests/QtAutogen/rccEmptyRes.qrc
diff --git a/Tests/QtAutogen/rcc_empty.cpp b/Tests/QtAutogen/rccOnly.cpp
index 3f9f9a2..61c7bf4 100644
--- a/Tests/QtAutogen/rcc_empty.cpp
+++ b/Tests/QtAutogen/rccOnly.cpp
@@ -1,9 +1,9 @@
-extern int qInitResources_rcc_empty_resource();
+extern int qInitResources_rccOnlyRes();
int main(int, char**)
{
// Fails to link if the symbol is not present.
- qInitResources_rcc_empty_resource();
+ qInitResources_rccOnlyRes();
return 0;
}
diff --git a/Tests/QtAutogen/rccOnlyRes.qrc b/Tests/QtAutogen/rccOnlyRes.qrc
new file mode 100644
index 0000000..5551348
--- /dev/null
+++ b/Tests/QtAutogen/rccOnlyRes.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>rccOnly.cpp</file>
+</qresource>
+</RCC>
diff --git a/Tests/QtAutogen/sameName/CMakeLists.txt b/Tests/QtAutogen/sameName/CMakeLists.txt
index ed045fb..9e47a3e 100644
--- a/Tests/QtAutogen/sameName/CMakeLists.txt
+++ b/Tests/QtAutogen/sameName/CMakeLists.txt
@@ -16,6 +16,5 @@ add_executable(sameName
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 )
+set_target_properties(sameName PROPERTIES AUTOMOC TRUE AUTORCC TRUE)
diff --git a/Tests/QtAutogen/skipMoc.cpp b/Tests/QtAutogen/skipMoc.cpp
new file mode 100644
index 0000000..85305f5
--- /dev/null
+++ b/Tests/QtAutogen/skipMoc.cpp
@@ -0,0 +1,14 @@
+
+#include "skipSource/qItemA.hpp"
+#include "skipSource/qItemB.hpp"
+#include "skipSource/qItemC.hpp"
+
+int main(int, char**)
+{
+ QItemA itemA;
+ QItemA itemB;
+ QItemA itemC;
+
+ // Fails to link if the symbol is not present.
+ return 0;
+}
diff --git a/Tests/QtAutogen/skipRcc.cpp b/Tests/QtAutogen/skipRcc.cpp
new file mode 100644
index 0000000..ec57110
--- /dev/null
+++ b/Tests/QtAutogen/skipRcc.cpp
@@ -0,0 +1,9 @@
+
+extern int qInitResources_skipRccGood();
+
+int main(int, char**)
+{
+ // Fails to link if the symbol is not present.
+ qInitResources_skipRccGood();
+ return 0;
+}
diff --git a/Tests/QtAutogen/skipSource/qItemA.cpp b/Tests/QtAutogen/skipSource/qItemA.cpp
new file mode 100644
index 0000000..522c2c7
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemA.cpp
@@ -0,0 +1,5 @@
+#include "qItemA.hpp"
+
+void QItemA::go()
+{
+}
diff --git a/Tests/QtAutogen/skipSource/qItemA.hpp b/Tests/QtAutogen/skipSource/qItemA.hpp
new file mode 100644
index 0000000..d295faf
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemA.hpp
@@ -0,0 +1,13 @@
+#ifndef QITEMA_HPP
+#define QITEMA_HPP
+
+#include <QObject>
+
+class QItemA : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+
+#endif
diff --git a/Tests/QtAutogen/skipSource/qItemB.cpp b/Tests/QtAutogen/skipSource/qItemB.cpp
new file mode 100644
index 0000000..636e15d
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemB.cpp
@@ -0,0 +1,5 @@
+#include "qItemB.hpp"
+
+void QItemB::go()
+{
+}
diff --git a/Tests/QtAutogen/skipSource/qItemB.hpp b/Tests/QtAutogen/skipSource/qItemB.hpp
new file mode 100644
index 0000000..1775915
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemB.hpp
@@ -0,0 +1,13 @@
+#ifndef QITEMB_HPP
+#define QITEMB_HPP
+
+#include <QObject>
+
+class QItemB : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+
+#endif
diff --git a/Tests/QtAutogen/skipSource/qItemC.cpp b/Tests/QtAutogen/skipSource/qItemC.cpp
new file mode 100644
index 0000000..700abd6
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemC.cpp
@@ -0,0 +1,5 @@
+#include "qItemC.hpp"
+
+void QItemC::go()
+{
+}
diff --git a/Tests/QtAutogen/skipSource/qItemC.hpp b/Tests/QtAutogen/skipSource/qItemC.hpp
new file mode 100644
index 0000000..f06bda2
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemC.hpp
@@ -0,0 +1,13 @@
+#ifndef QITEMC_HPP
+#define QITEMC_HPP
+
+#include <QObject>
+
+class QItemC : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+
+#endif
diff --git a/Tests/QtAutogen/skipSource/skipRccBad1.qrc b/Tests/QtAutogen/skipSource/skipRccBad1.qrc
new file mode 100644
index 0000000..6cbd9ed
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/skipRccBad1.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>skipRccGood.cpp</file>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+</qresource>
+</RCC>
diff --git a/Tests/QtAutogen/skipSource/skipRccBad2.qrc b/Tests/QtAutogen/skipSource/skipRccBad2.qrc
new file mode 100644
index 0000000..b32c589
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/skipRccBad2.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><
+<qresource>
+ <file>skipRccGood.cpp</file>
+</qresource>
+</RCC>
diff --git a/Tests/QtAutogen/skipSource/skipRccGood.qrc b/Tests/QtAutogen/skipSource/skipRccGood.qrc
new file mode 100644
index 0000000..21a94b0
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/skipRccGood.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>skipRccBad1.qrc</file>
+ <file>skipRccBad2.qrc</file>
+</qresource>
+</RCC>
diff --git a/Tests/QtAutogen/skipSource/skipUicGen.cpp b/Tests/QtAutogen/skipSource/skipUicGen.cpp
new file mode 100644
index 0000000..d2a55a6
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/skipUicGen.cpp
@@ -0,0 +1,7 @@
+
+#include "skipUicGen.hpp"
+#include "ui_uigen2.h"
+
+void skipGen()
+{
+}
diff --git a/Tests/QtAutogen/skipSource/skipUicGen.hpp b/Tests/QtAutogen/skipSource/skipUicGen.hpp
new file mode 100644
index 0000000..3669f0e
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/skipUicGen.hpp
@@ -0,0 +1,8 @@
+#ifndef SKIPUICGEN_HPP
+#define SKIPUICGEN_HPP
+
+#include "ui_uigen1.h"
+
+void skipGen();
+
+#endif
diff --git a/Tests/QtAutogen/skipSource/skipUicNoGen1.cpp b/Tests/QtAutogen/skipSource/skipUicNoGen1.cpp
new file mode 100644
index 0000000..f591a42
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/skipUicNoGen1.cpp
@@ -0,0 +1,7 @@
+
+#include "skipUicNoGen1.hpp"
+#include "ui_nogen2.h"
+
+void skipNoGen1()
+{
+}
diff --git a/Tests/QtAutogen/skipSource/skipUicNoGen1.hpp b/Tests/QtAutogen/skipSource/skipUicNoGen1.hpp
new file mode 100644
index 0000000..2864695
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/skipUicNoGen1.hpp
@@ -0,0 +1,8 @@
+#ifndef SKIPUICNOGEN1_H
+#define SKIPUICNOGEN1_H
+
+#include "ui_nogen1.h"
+
+void skipNoGen1();
+
+#endif
diff --git a/Tests/QtAutogen/skipSource/skipUicNoGen2.cpp b/Tests/QtAutogen/skipSource/skipUicNoGen2.cpp
new file mode 100644
index 0000000..8c1c324
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/skipUicNoGen2.cpp
@@ -0,0 +1,7 @@
+
+#include "skipUicNoGen2.hpp"
+#include "ui_nogen2.h"
+
+void skipNoGen2()
+{
+}
diff --git a/Tests/QtAutogen/skipSource/skipUicNoGen2.hpp b/Tests/QtAutogen/skipSource/skipUicNoGen2.hpp
new file mode 100644
index 0000000..7c38193
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/skipUicNoGen2.hpp
@@ -0,0 +1,8 @@
+#ifndef SKIPUICNOGEN2_H
+#define SKIPUICNOGEN2_H
+
+#include "ui_nogen1.h"
+
+void skipNoGen2();
+
+#endif
diff --git a/Tests/QtAutogen/skipSource/ui_nogen1.h b/Tests/QtAutogen/skipSource/ui_nogen1.h
new file mode 100644
index 0000000..a7be52b
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/ui_nogen1.h
@@ -0,0 +1,6 @@
+#ifndef UI_NOGEN1_H
+#define UI_NOGEN1_H
+
+void ui_nogen1();
+
+#endif
diff --git a/Tests/QtAutogen/skipSource/ui_nogen2.h b/Tests/QtAutogen/skipSource/ui_nogen2.h
new file mode 100644
index 0000000..5d547d4
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/ui_nogen2.h
@@ -0,0 +1,6 @@
+#ifndef UI_NOGEN2_H
+#define UI_NOGEN2_H
+
+void ui_nogen2();
+
+#endif \ No newline at end of file
diff --git a/Tests/QtAutogen/skipSource/uigen1.ui b/Tests/QtAutogen/skipSource/uigen1.ui
new file mode 100644
index 0000000..fc7cb82
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/uigen1.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>UiGen1</class>
+ <widget class="QWidget" name="UiGen1">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTreeView" name="treeView"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Tests/QtAutogen/skipSource/uigen2.ui b/Tests/QtAutogen/skipSource/uigen2.ui
new file mode 100644
index 0000000..01f08d2
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/uigen2.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>UiGen2</class>
+ <widget class="QWidget" name="UiGen2">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTreeView" name="treeView"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Tests/QtAutogen/skipUic.cpp b/Tests/QtAutogen/skipUic.cpp
new file mode 100644
index 0000000..0adf011
--- /dev/null
+++ b/Tests/QtAutogen/skipUic.cpp
@@ -0,0 +1,22 @@
+
+#include "skipSource/skipUicGen.hpp"
+#include "skipSource/skipUicNoGen1.hpp"
+#include "skipSource/skipUicNoGen2.hpp"
+
+int main(int, char**)
+{
+ skipGen();
+ skipNoGen1();
+ skipNoGen2();
+
+ return 0;
+}
+
+// -- Function definitions
+void ui_nogen1()
+{
+}
+
+void ui_nogen2()
+{
+}
diff --git a/Tests/QtAutogen/sub/uiconly.cpp b/Tests/QtAutogen/uicOnlySource/uiconly.cpp
index ac22789..7b91b25 100644
--- a/Tests/QtAutogen/sub/uiconly.cpp
+++ b/Tests/QtAutogen/uicOnlySource/uiconly.cpp
@@ -7,6 +7,11 @@ UicOnly::UicOnly(QWidget* parent)
{
}
+UicOnly::~UicOnly()
+{
+ delete ui;
+}
+
int main()
{
return 0;
diff --git a/Tests/QtAutogen/sub/uiconly.h b/Tests/QtAutogen/uicOnlySource/uiconly.h
index 9b0b1b4..8f4eebe 100644
--- a/Tests/QtAutogen/sub/uiconly.h
+++ b/Tests/QtAutogen/uicOnlySource/uiconly.h
@@ -3,7 +3,6 @@
#define UIC_ONLY_H
#include <QWidget>
-#include <memory>
#include "ui_uiconly.h"
@@ -12,9 +11,10 @@ class UicOnly : public QWidget
Q_OBJECT
public:
explicit UicOnly(QWidget* parent = 0);
+ ~UicOnly();
private:
- const std::auto_ptr<Ui::UicOnly> ui;
+ Ui::UicOnly* ui;
};
#endif
diff --git a/Tests/QtAutogen/sub/uiconly.ui b/Tests/QtAutogen/uicOnlySource/uiconly.ui
index 13fb832..13fb832 100644
--- a/Tests/QtAutogen/sub/uiconly.ui
+++ b/Tests/QtAutogen/uicOnlySource/uiconly.ui