[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    [CMake] Custom compile command?
From:       Bob Tanner <tanner () real-time ! com>
Date:       2009-06-04 20:18:25
Message-ID: h09a6h$ukj$1 () ger ! gmane ! org
[Download RAW message or body]

I'm moving an open source project (netrek) to cmake. Things are going 
great except for 1 fairly convoluted Makefile snippet listed below:


commands_mars.o: $(PMAKE) ${srcdir}/../ntserv/commands.c
        $(CC) $(CFLAGS) $(DEP) -DDOG -c ${srcdir}/../ntserv/commands.c 
-o commands_mars.o

commands_puck.o: $(PMAKE) ${srcdir}/../ntserv/commands.c
        $(CC) $(CFLAGS) $(DEP) -DPUCK -c ${srcdir}/../ntserv/commands.c 
-o commands_puck.o

commands.o: $(PMAKE) ${srcdir}/../ntserv/commands.c
        $(CC) $(CFLAGS) $(DEP) -c ${srcdir}/../ntserv/commands.c -o commands.o

commands_basep.o: $(PMAKE) ${srcdir}/../ntserv/commands.c
        $(CC) $(CFLAGS) $(DEP) -DBASEP -c 
${srcdir}/../ntserv/commands.c -o commands_basep.o


The Makefile takes the same .c file (../ntserv/commands.c) and compiles 
it multiple times passing in a different -D (-DDOG, -DPUCK) and 
outputting a different object file (-o commands_mars,
-o commands_puck).

How would I do this in cmake?

I looked at the ADD_CUSTOM_COMMAND but that doesn't seem the way to go.

Any advise?

Thanks.

-- 
Bob Tanner <tanner@real-time.com>                  | Phone : (952 943-8700
http://www.real-time.com, Linux, OSX, VMware | Fax   : (952)943-8500
Key fingerprint = F785 DDFC CF94 7CE8 AA87 3A9D 3895 26F1 0DDB E378


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic