diff options
author | Brad King <brad.king@kitware.com> | 2023-05-22 16:38:24 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-05-22 16:38:33 (GMT) |
commit | 8ce4e76dbf068779c2664c28142eead093f29edf (patch) | |
tree | f007ede08c3bcc96709c34a2622e21deee666ce0 /Tests | |
parent | 970716e232de344cbf519d88955e58b3c925f877 (diff) | |
parent | 08d49cfee69e16383373af4ddcc03a82afe250d2 (diff) | |
download | CMake-8ce4e76dbf068779c2664c28142eead093f29edf.zip CMake-8ce4e76dbf068779c2664c28142eead093f29edf.tar.gz CMake-8ce4e76dbf068779c2664c28142eead093f29edf.tar.bz2 |
Merge topic 'autogen-test-file-generate'
08d49cfee6 Autogen: Add AUTOMOC test /w file(Generate)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8496
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/QtAutogen/AutoMocGeneratedFile/CMakeLists.txt | 23 | ||||
-rw-r--r-- | Tests/QtAutogen/AutoMocGeneratedFile/main.cpp | 7 | ||||
-rw-r--r-- | Tests/QtAutogen/Tests.cmake | 1 |
3 files changed, 31 insertions, 0 deletions
diff --git a/Tests/QtAutogen/AutoMocGeneratedFile/CMakeLists.txt b/Tests/QtAutogen/AutoMocGeneratedFile/CMakeLists.txt new file mode 100644 index 0000000..ce129a9 --- /dev/null +++ b/Tests/QtAutogen/AutoMocGeneratedFile/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.26) +project(AutoMocGeneratedFile) + +include("../AutogenCoreTest.cmake") + +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/myConfig.h + CONTENT + " +#ifndef MYCONFIG_H +#define MYCONFIG_H + +inline void foo() {} + +#endif + +" +) + +add_executable(testTarget + main.cpp + ${CMAKE_CURRENT_BINARY_DIR}/myConfig.h) +target_include_directories(testTarget PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +set_property(TARGET testTarget PROPERTY AUTOMOC ON) diff --git a/Tests/QtAutogen/AutoMocGeneratedFile/main.cpp b/Tests/QtAutogen/AutoMocGeneratedFile/main.cpp new file mode 100644 index 0000000..e30d889 --- /dev/null +++ b/Tests/QtAutogen/AutoMocGeneratedFile/main.cpp @@ -0,0 +1,7 @@ +#include "myConfig.h" + +int main() +{ + foo(); + return 0; +} diff --git a/Tests/QtAutogen/Tests.cmake b/Tests/QtAutogen/Tests.cmake index 3e4f04d..7dd9c84 100644 --- a/Tests/QtAutogen/Tests.cmake +++ b/Tests/QtAutogen/Tests.cmake @@ -2,6 +2,7 @@ ADD_AUTOGEN_TEST(AutogenOriginDependsOff autogenOriginDependsOff) ADD_AUTOGEN_TEST(AutogenOriginDependsOn) ADD_AUTOGEN_TEST(AutogenTargetDepends) +ADD_AUTOGEN_TEST(AutoMocGeneratedFile) ADD_AUTOGEN_TEST(Complex QtAutogen) ADD_AUTOGEN_TEST(GlobalAutogenSystemUseInclude) ADD_AUTOGEN_TEST(GlobalAutogenTarget) |