I need to generate a C++ header file that describes the compiler used.
Traditionally we used the CMake command:
configure( ${PROJECT_SOURCE_DIR}/configure.h.in ${PROJECT_BINARY_DIR}/configure.h )
which replaces all string sandwiched by "@" (for example @cxx_compiler_name@) with the value of that variable in the cmake build system.
We have been given the requirement to face out CMake, so is there something equivalent in Visual Studio. I'd like to populate the header file with some of the values in the Visual Studio macros.
settings is located in the My Project folder for Visual Basic projects and in the Properties folder for Visual C# projects. The Project Designer then searches for other settings files in the project's root folder. Therefore, you should put your custom settings file there.
If you need a configuration file for your application, open your project in VS.NET, go to the 'Solution Explorer' and right click on the project name. Choose Add > Add new item from the menu and select 'Application Configuration file' from the list of choices. This will create an app.
You can add your configure.h.in
file to the project and set a custom build for it that will run perl
or sed
and replace whatever needed. Don't forget to add configure.h
to output files property so Visual Studio can figure out the dependencies and "build" configure.h.in
before other sources that use configure.h
.
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