I use CMake like that:
$ mkdir build && cd build
$ cmake .. && make && atf-run | atf-report
But to run atf I need some files (for example /Atffile and test/Atffile), so I'm looking for a way to import in my build directory all that kind file.
I tried this:
file(COPY ${PROJECT_SOURCE_DIR}/.. DESTINATION ${PROJECT_SOURCE_DIR}/..)
But it doesn't work. Is their a simple/cleaner way to do it?
Assuming "/Atffile" and "/test/Atffile" are files and not folders, you can use configure_file
configure_file(Atffile Atffile COPYONLY)
configure_file(test/Atffile test/Atffile COPYONLY)
Since the commands here use relative paths throughout, the input arg is relative to the current source directory and the output arg is relative to the current binary (i.e. build) directory.
I use the following to copy a complete directory into the build directory
file(COPY "datasets" DESTINATION "${CMAKE_BINARY_DIR}")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With