diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-08-07 21:45:40 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-08-07 23:14:45 (GMT) |
commit | 1e9ec93f482ef022b538d5d9f419d26cd8ecfa6d (patch) | |
tree | 157637b415e93707cd28f8bd513281ad26b54a9e /Tests | |
parent | 4240e74858aebf82fb1b371bf15f84e509d13966 (diff) | |
download | CMake-1e9ec93f482ef022b538d5d9f419d26cd8ecfa6d.zip CMake-1e9ec93f482ef022b538d5d9f419d26cd8ecfa6d.tar.gz CMake-1e9ec93f482ef022b538d5d9f419d26cd8ecfa6d.tar.bz2 |
Tests/RunCMake/CXXModules: actually generate the source at build time
This tests what is intended to be tested (sources that do not exist
until after the configure has run).
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CXXModules/examples/generated-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/Tests/RunCMake/CXXModules/examples/generated-stderr.txt b/Tests/RunCMake/CXXModules/examples/generated-stderr.txt index 1dd9876..06160ce 100644 --- a/Tests/RunCMake/CXXModules/examples/generated-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/generated-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:12 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:16 \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt index 73f7ff7..9a8da3d 100644 --- a/Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt @@ -3,10 +3,14 @@ project(cxx_modules_generated CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/importable.cxx.in" - "${CMAKE_CURRENT_BINARY_DIR}/importable.cxx" - COPYONLY) +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/importable.cxx" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/importable.cxx.in" + COMMAND "${CMAKE_COMMAND}" + -E copy_if_different + "${CMAKE_CURRENT_SOURCE_DIR}/importable.cxx.in" + "${CMAKE_CURRENT_BINARY_DIR}/importable.cxx" + COMMENT "Copying 'importable.cxx'") add_executable(generated) target_sources(generated |