Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Bob Tanner <tanner-nLfnTIhOdZRl57MIdRCFDg <at> public.gmane.org>
Subject: Custom compile command?
Newsgroups: gmane.comp.programming.tools.cmake.user
Date: Thursday 4th June 2009 20:18:25 UTC (over 8 years ago)
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                 
 | 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
 
CD: 3ms