summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2023-09-25 13:40:54 (GMT)
committerBrad King <brad.king@kitware.com>2023-09-26 15:54:16 (GMT)
commitc3f0825d3c0876829d066493a3fc0f0a516fb0f2 (patch)
treed14bdaed1b18e0b1400be80145d6f53e14bb24d5
parent9654835b4f3c0e7b5fe41405f12c762875b54c6b (diff)
downloadCMake-c3f0825d3c0876829d066493a3fc0f0a516fb0f2.zip
CMake-c3f0825d3c0876829d066493a3fc0f0a516fb0f2.tar.gz
CMake-c3f0825d3c0876829d066493a3fc0f0a516fb0f2.tar.bz2
Tests/RunCMake/Autogen: Factor out test setup
-rw-r--r--Tests/RunCMake/Autogen/AutoMocExecutableConfig.cmake13
-rw-r--r--Tests/RunCMake/Autogen/AutoRccExecutableConfig.cmake13
-rw-r--r--Tests/RunCMake/Autogen/AutoUicExecutableConfig.cmake13
-rw-r--r--Tests/RunCMake/Autogen/MocExample.cmake11
-rw-r--r--Tests/RunCMake/Autogen/RccExample.cmake11
-rw-r--r--Tests/RunCMake/Autogen/UicExample.cmake11
6 files changed, 39 insertions, 33 deletions
diff --git a/Tests/RunCMake/Autogen/AutoMocExecutableConfig.cmake b/Tests/RunCMake/Autogen/AutoMocExecutableConfig.cmake
index fd3614c..3ee9be9 100644
--- a/Tests/RunCMake/Autogen/AutoMocExecutableConfig.cmake
+++ b/Tests/RunCMake/Autogen/AutoMocExecutableConfig.cmake
@@ -1,17 +1,9 @@
-enable_language(CXX)
-
-set(CMAKE_CXX_STANDARD 11)
-find_package(Qt${with_qt_version} REQUIRED COMPONENTS Core Widgets Gui)
+include(MocExample.cmake)
if(NOT TARGET Qt${with_qt_version}::moc)
message(FATAL_ERROR "Qt${with_qt_version}::moc not found")
endif()
-add_library(dummy STATIC example.cpp)
-target_link_libraries(dummy Qt${with_qt_version}::Core
- Qt${with_qt_version}::Widgets
- Qt${with_qt_version}::Gui)
-
get_target_property(moc_location Qt${with_qt_version}::moc IMPORTED_LOCATION)
set_target_properties(dummy PROPERTIES AUTOMOC_MOC_OPTIONS "EXE_PATH=${moc_location}")
@@ -20,5 +12,4 @@ add_executable(mymoc $<$<CONFIG:Debug>:exe_debug.cpp>
$<$<CONFIG:RelWithDebInfo>:exe_relwithdebinfo.cpp>
)
-set_target_properties(dummy PROPERTIES AUTOMOC_EXECUTABLE $<TARGET_FILE:mymoc>
- AUTOMOC ON)
+set_target_properties(dummy PROPERTIES AUTOMOC_EXECUTABLE $<TARGET_FILE:mymoc>)
diff --git a/Tests/RunCMake/Autogen/AutoRccExecutableConfig.cmake b/Tests/RunCMake/Autogen/AutoRccExecutableConfig.cmake
index a0e9ce9..0e46420 100644
--- a/Tests/RunCMake/Autogen/AutoRccExecutableConfig.cmake
+++ b/Tests/RunCMake/Autogen/AutoRccExecutableConfig.cmake
@@ -1,17 +1,9 @@
-enable_language(CXX)
-
-set(CMAKE_CXX_STANDARD 11)
-find_package(Qt${with_qt_version} REQUIRED COMPONENTS Core Widgets Gui)
+include(RccExample.cmake)
if(NOT TARGET Qt${with_qt_version}::rcc)
message(FATAL_ERROR "Qt${with_qt_version}::rcc not found")
endif()
-add_library(dummy STATIC example.cpp data.qrc)
-target_link_libraries(dummy Qt${with_qt_version}::Core
- Qt${with_qt_version}::Widgets
- Qt${with_qt_version}::Gui)
-
get_target_property(rcc_location Qt${with_qt_version}::rcc IMPORTED_LOCATION)
set_target_properties(dummy PROPERTIES AUTORCC_OPTIONS "EXE_PATH=${rcc_location}")
@@ -20,5 +12,4 @@ add_executable(myrcc $<$<CONFIG:Debug>:exe_debug.cpp>
$<$<CONFIG:RelWithDebInfo>:exe_relwithdebinfo.cpp>
)
-set_target_properties(dummy PROPERTIES AUTORCC_EXECUTABLE $<TARGET_FILE:myrcc>
- AUTORCC ON)
+set_target_properties(dummy PROPERTIES AUTORCC_EXECUTABLE $<TARGET_FILE:myrcc>)
diff --git a/Tests/RunCMake/Autogen/AutoUicExecutableConfig.cmake b/Tests/RunCMake/Autogen/AutoUicExecutableConfig.cmake
index ce7675e..55b88b8 100644
--- a/Tests/RunCMake/Autogen/AutoUicExecutableConfig.cmake
+++ b/Tests/RunCMake/Autogen/AutoUicExecutableConfig.cmake
@@ -1,17 +1,9 @@
-enable_language(CXX)
-
-set(CMAKE_CXX_STANDARD 11)
-find_package(Qt${with_qt_version} REQUIRED COMPONENTS Core Widgets Gui)
+include(UicExample.cmake)
if(NOT TARGET Qt${with_qt_version}::uic)
message(FATAL_ERROR "Qt${with_qt_version}::uic not found")
endif()
-add_library(dummy STATIC example_ui.cpp uiA.ui)
-target_link_libraries(dummy Qt${with_qt_version}::Core
- Qt${with_qt_version}::Widgets
- Qt${with_qt_version}::Gui)
-
get_target_property(uic_location Qt${with_qt_version}::uic IMPORTED_LOCATION)
set_target_properties(dummy PROPERTIES AUTOUIC_OPTIONS "EXE_PATH=${uic_location}")
@@ -20,5 +12,4 @@ add_executable(myuic $<$<CONFIG:Debug>:exe_debug.cpp>
$<$<CONFIG:RelWithDebInfo>:exe_relwithdebinfo.cpp>
)
-set_target_properties(dummy PROPERTIES AUTOUIC_EXECUTABLE $<TARGET_FILE:myuic>
- AUTOUIC ON)
+set_target_properties(dummy PROPERTIES AUTOUIC_EXECUTABLE $<TARGET_FILE:myuic>)
diff --git a/Tests/RunCMake/Autogen/MocExample.cmake b/Tests/RunCMake/Autogen/MocExample.cmake
new file mode 100644
index 0000000..f06f8f6
--- /dev/null
+++ b/Tests/RunCMake/Autogen/MocExample.cmake
@@ -0,0 +1,11 @@
+enable_language(CXX)
+
+set(CMAKE_CXX_STANDARD 11)
+find_package(Qt${with_qt_version} REQUIRED COMPONENTS Core Widgets Gui)
+
+add_library(dummy STATIC example.cpp)
+target_link_libraries(dummy Qt${with_qt_version}::Core
+ Qt${with_qt_version}::Widgets
+ Qt${with_qt_version}::Gui)
+
+set_target_properties(dummy PROPERTIES AUTOMOC ON)
diff --git a/Tests/RunCMake/Autogen/RccExample.cmake b/Tests/RunCMake/Autogen/RccExample.cmake
new file mode 100644
index 0000000..4554eb0
--- /dev/null
+++ b/Tests/RunCMake/Autogen/RccExample.cmake
@@ -0,0 +1,11 @@
+enable_language(CXX)
+
+set(CMAKE_CXX_STANDARD 11)
+find_package(Qt${with_qt_version} REQUIRED COMPONENTS Core Widgets Gui)
+
+add_library(dummy STATIC example.cpp data.qrc)
+target_link_libraries(dummy Qt${with_qt_version}::Core
+ Qt${with_qt_version}::Widgets
+ Qt${with_qt_version}::Gui)
+
+set_target_properties(dummy PROPERTIES AUTORCC ON)
diff --git a/Tests/RunCMake/Autogen/UicExample.cmake b/Tests/RunCMake/Autogen/UicExample.cmake
new file mode 100644
index 0000000..4b1f8c1
--- /dev/null
+++ b/Tests/RunCMake/Autogen/UicExample.cmake
@@ -0,0 +1,11 @@
+enable_language(CXX)
+
+set(CMAKE_CXX_STANDARD 11)
+find_package(Qt${with_qt_version} REQUIRED COMPONENTS Core Widgets Gui)
+
+add_library(dummy STATIC example_ui.cpp uiA.ui)
+target_link_libraries(dummy Qt${with_qt_version}::Core
+ Qt${with_qt_version}::Widgets
+ Qt${with_qt_version}::Gui)
+
+set_target_properties(dummy PROPERTIES AUTOUIC ON)