mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-13 01:29:02 -05:00
Tests/RunCMake/Autogen: Factor out test setup
This commit is contained in:
committed by
Brad King
parent
9654835b4f
commit
c3f0825d3c
@@ -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>)
|
||||
|
||||
@@ -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>)
|
||||
|
||||
@@ -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>)
|
||||
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user