Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Visual Studio generate configure file?

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.

like image 704
KlingonJoe Avatar asked Feb 08 '17 15:02

KlingonJoe


People also ask

Where is Visual Studio config file?

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.

How create config file in VB NET?

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.


1 Answers

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.

like image 82
Paul Avatar answered Sep 30 '22 19:09

Paul