diff options
Diffstat (limited to 'Tests/RunCMake/Autogen/QtAutoMocDeps.cmake')
-rw-r--r-- | Tests/RunCMake/Autogen/QtAutoMocDeps.cmake | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Tests/RunCMake/Autogen/QtAutoMocDeps.cmake b/Tests/RunCMake/Autogen/QtAutoMocDeps.cmake new file mode 100644 index 0000000..fc3b2f2 --- /dev/null +++ b/Tests/RunCMake/Autogen/QtAutoMocDeps.cmake @@ -0,0 +1,23 @@ +enable_language(CXX) + +find_package(Qt${with_qt_version} REQUIRED COMPONENTS Core Widgets Gui) + +set(CMAKE_AUTOMOC ON) + +add_library(simple_lib SHARED simple_lib.cpp) +add_executable(app_with_qt app.cpp app_qt.cpp) +target_link_libraries(app_with_qt PRIVATE simple_lib Qt${with_qt_version}::Core) + +if(${with_qt_version}Widgets_DIR) + if(with_qt_version STREQUAL 5) + qt5_wrap_ui(_headers MyWindow.ui) + else() + qt_wrap_ui(_headers MyWindow.ui) + endif() + add_executable(app_with_widget app.cpp MyWindow.cpp ${_headers}) + target_link_libraries(app_with_widget PRIVATE Qt${with_qt_version}::Widgets) + target_include_directories(app_with_widget PRIVATE "${CMAKE_BINARY_DIR}") +endif() +add_subdirectory(QtSubDir1) +add_subdirectory(QtSubDir2) +add_subdirectory(QtSubDir3) |