I have a C/C++ project that was written to be configured with CMake
. I'm trying to learn Qbs
by converting it to use Qbs
. It happen there are .h.in
files that in CMake
are configured using the configure_file()
function. For example in CMake
a file named bson-version.h.in
is converted to bson-version.h
using the below code.
configure_file (
"${SOURCE_DIR}/src/bson/bson-version.h.in"
"${PROJECT_BINARY_DIR}/src/bson/bson-version.h"
)
How can this be achieved in Qbs? I'm on Windows 10 x64.
There is no built-in functionality for this. You can easily implement it yourself, though. Here's a sketch (untested):
Of course, if the .in file refers to cmake variables, you will have to define equivalent qbs properties in your project and consider them in the rule.