views:

19

answers:

1

I have a project which can be compiled with Visual Studio, GCC and with some embedded compilers. Sources are shared, but each platform requires separate makefiles, project files, solutions etc. There are two ways I can organize them:

  1. Intermixed in a single hierarchy of folders
  2. With separate folders for platform-dependent files

The first solution creates some confusion about which file belongs to which platform, but the second causes some repetition of the folders structure (some compilers require each project to have a separate folder).

Which do you think is better?

A: 

I would advise you to look at CMake.

It can generate native Unix Makefiles, Visual Studio projects, Eclipse Projects, etc.

You will still be able to write custom platform rules to tweak the build process, but way easier.

the_void

related questions