[Cmake] DSP dependencies

Ansel Freniere ansel at lambdares.com
Tue Dec 17 07:37:20 EST 2002


Hi, I'm a new user to CMake.  We are evaluating CMake for 
cross-platform builds of our OSLO lens design product.  I have 
successfully generated some makefiles for our project, but the 
dependencies do not quite work under Developer Studio, causing 
excessive building.
There are two dependency problems.

First problem:
We have a few custom-built executables which, when run, build some 
files (binary data) and c source and header files during the build.  I 
can not quite see how to encode these dependencies into CMake so that 
they work properly and only build when necessary.  I do see that it 
would seem to require something using ADD_CUSTOM_TARGET and/or 
ADD_CUSTOM_COMMAND, but I can't quite tell how to use these commands.  
For example, in a traditional unix makefile I would have:

app: data.bin defs.h app.c app.h
	gcc app.c -o app

defs.h: data.txt compile
	compile data.txt

data.bin: data.txt compile
	compile data.txt

compile: compile.c
	gcc -o compile compile.c

This generates two output files, one of which is a generated C header 
file.  I see how to use SOURCE_FILES with the GENERATED keyword to mark 
c source files that are generated at make time.  However, how do I use 
a custom command to tell CMake how to see the dependencies that this 
command has, and how to build them?  This is all complicated by the 
fact that the compile command actually generates two output files.

Second problem:
When I build my executable, I need some libraries that are built within 
the same workspace in other projects.  But CMake does not pass on this 
inter-project dependency information to the developer studio workspace 
(.dsw), and so there is no guarantee that the lib will get built before 
the executable.  How can I get cmake to encode this information into 
the dsw?

TIA.

-Ansel.
--
Ansel Freniere
Lambda Research Corporation
80 Taylor Street
P.O. Box 1400
Littleton, MA 01460-4400 USA
PH: 978-486-0766 FAX: 978-486-0755
http://www.lambdares.com




More information about the CMake mailing list