summaryrefslogtreecommitdiff
path: root/Tests/Qt4And5Automoc
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Qt4And5Automoc')
-rw-r--r--Tests/Qt4And5Automoc/CMakeLists.txt15
-rw-r--r--Tests/Qt4And5Automoc/main.cpp.in (renamed from Tests/Qt4And5Automoc/main.cpp)0
-rw-r--r--Tests/Qt4And5Automoc/main_qt4.cpp4
-rw-r--r--Tests/Qt4And5Automoc/main_qt5.cpp4
4 files changed, 13 insertions, 10 deletions
diff --git a/Tests/Qt4And5Automoc/CMakeLists.txt b/Tests/Qt4And5Automoc/CMakeLists.txt
index 0cc80fe73f..61d5743662 100644
--- a/Tests/Qt4And5Automoc/CMakeLists.txt
+++ b/Tests/Qt4And5Automoc/CMakeLists.txt
@@ -1,3 +1,4 @@
+cmake_minimum_required(VERSION 2.8.12)
project(Qt4And5Automoc)
@@ -7,7 +8,17 @@ find_package(Qt5Core REQUIRED)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
-add_executable(qt4_exe main_qt4.cpp)
+macro(generate_main_file VERSION)
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/main.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/main_qt${VERSION}.cpp" COPYONLY)
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/main_qt${VERSION}.cpp"
+ "#include \"main_qt${VERSION}.moc\"\n"
+ )
+endmacro()
+
+generate_main_file(4)
+generate_main_file(5)
+
+add_executable(qt4_exe "${CMAKE_CURRENT_BINARY_DIR}/main_qt4.cpp")
target_link_libraries(qt4_exe Qt4::QtCore)
-add_executable(qt5_exe main_qt5.cpp)
+add_executable(qt5_exe "${CMAKE_CURRENT_BINARY_DIR}/main_qt5.cpp")
target_link_libraries(qt5_exe Qt5::Core)
diff --git a/Tests/Qt4And5Automoc/main.cpp b/Tests/Qt4And5Automoc/main.cpp.in
index 00fd641535..00fd641535 100644
--- a/Tests/Qt4And5Automoc/main.cpp
+++ b/Tests/Qt4And5Automoc/main.cpp.in
diff --git a/Tests/Qt4And5Automoc/main_qt4.cpp b/Tests/Qt4And5Automoc/main_qt4.cpp
deleted file mode 100644
index a84ce897fd..0000000000
--- a/Tests/Qt4And5Automoc/main_qt4.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-
-#include "main.cpp"
-
-#include "main_qt4.moc"
diff --git a/Tests/Qt4And5Automoc/main_qt5.cpp b/Tests/Qt4And5Automoc/main_qt5.cpp
deleted file mode 100644
index 287b261372..0000000000
--- a/Tests/Qt4And5Automoc/main_qt5.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-
-#include "main.cpp"
-
-#include "main_qt5.moc"