mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-25 07:58:59 -06:00
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).
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user