[CMake] How to build 2 targets from the same source, differing in -D_SWITCHES_ only

Eike Kroemer eike-michael.kroemer at atlas-elektronik.com
Mon Aug 31 01:56:47 EDT 2009


Hi Marcel,

[...]
> See tiny example below (hope this helps).
Yes, it does, thank you very much for the detailed walkthrough.

Based on your suggestion I've experimented a bit and found that my key
issues were:

- introducing a separated build-directory structure - should have done
  that long before as my makefiles needed a 'make partialclean' and a
  flag-file .LAST_TARGET for switching between targets, ähh,
  historically grown....

- giving up on a single main Makefile/CMakeLists.txt for all targets,
  handling those as separate projects makes more sense (perhaps I'll
  keep my main Makefile just to call configure for all CMake-projects).

- stop calling cmake from a directory that is _common_ to all builds;
  changing into a build directory and CMaking from there works fine.

Thanks again,

  Eike


More information about the CMake mailing list