0

I switch between so many projects and IDEs a lot. They run each project with default options of IDE. For example

g++ test.cpp

I know make file can solve the problem. But it is not IDE friendly way. I am thinking if there is any way to impose option

-std=c++11

In the code rather than in calling g++.

The same problem with linker. I want to tell the linker in the code that I want to link to armadillo library

-larmadillo

Maybe setting a prepossessing command could solve the problem. Is there any solution for it?

barej
  • 1,330
  • 3
  • 25
  • 56

1 Answers1

0

Have you tried CMake? With this you can create compiler and IDE independent makefiles and then generate the makefiles/project files for the environment of your choise. You can freely script it so you can set certin swithces for gcc and other for vc++ or clang.

You can also use it if you want to create different build configurations.

Gábor Angyal
  • 2,225
  • 17
  • 27
  • I would instead suggest simply to learn GNU make (*without* using `cmake` to generate `Makefile`-s) – Basile Starynkevitch Feb 09 '15 at 09:22
  • @BasileStarynkevitch That is also a possible solution, but maybe insufficient. CMake can generate Visual Studio project files for example. (Although it is not specified in the question what IDE he wishes to use.) – Gábor Angyal Feb 09 '15 at 09:30