[Cmake] Object Suffixes

Peter Vanroose Peter . Vanroose at esat . kuleuven . ac . be
Thu, 10 Jul 2003 09:21:18 +0200 (CEST)


>     I don't mean to keep pestering you, but this solution doesn't seem
> to answer my question.  With your example, I have directories
>
> /home/z/world
> /home/z/world-linux
> /home/z/world-sun
>
> and the sources in /home/z/world.  I want to be able to run make without
> knowing which system I'm on.

Your setup can work with a simple additional makefile (hand-made) in
/home/z/world, which determines the operating system and then delegates
to one of the CMake generated ones, either in world-linux or world-sun.

Thus /home/z/world/makefile could look like this:
(I'm assuming unix and gnu make; more general is possible.)

### This is /home/z/world/makefile ###
# Run uname to distinguish unix systems
uname_output := $(strip $(shell uname))

ifneq (,$(findstring SunOS,$(uname_output)))
  cd ../world-sun && make
endif

ifneq (,$(findstring Linux,$(uname_output)))
  cd ../world-linux && make
endif
### end of makefile ###


--	Peter Vanroose.