Examples of using a C++ preprocessing script cpp-fstring to process python-style f-strings.
This companion repository shows how to incorporate cpp-format in a cmake environment, and has examples of using C++ f-strings.
See cpp-fstring
├── Makefile ├── include │ └── fstr.h ├── examples │ ├── CMakeLists.txt │ ├── psrc │ │ ├── demo_misc.cpp │ │ ├── ... │ │ ├── enum_namespace.cpp │ │ ├── fixed_size_string_buffer.h │ │ └── tinyply.h │ ├── src │ │ ├── demo_misc.cpp │ │ ├── ... │ │ ├── enum_namespace.cpp │ │ ├── fixed_size_string_buffer.h │ │ └── tinyply.h │ ├── out │ │ ├── demo_misc.log │ │ ├── ... │ │ └── enum_namespace.log
Look at the Makefile for debug or release targets.
The cmake command generates run files under build
dir and then
uses cpp-fstring to convert files under psrc
dir to src
dir.
This generated code is compiled and executed. in examples/CMakeLists.txt
the following cmake command adds the cpp-fstring step:
COMMAND cpp-fstring ${source} -I src -I ../include > ${target}
for a single file like examples/psrc/class_basic.cpp
this is equvalent to:
cpp-fstring examples/psrc/class_basic.cpp -I src -I ../include > examples/src/class_basic.cpp
- Sandeep - @d-e-e-p
The project is available under the MIT license. See LICENSE file for details