[CMake] Want to compile a file but does not want to link it in library

ankit jain ankitguddu at gmail.com
Tue May 26 01:29:37 EDT 2009


Hi all,

I have a folder f1 having 4 files c1.c c2.c c3.c c4.c.
Now iam compiling all these files with certain definitions and other
compiler flags.

Now what i want is that when iam building library for this forder f1 it does
not take c4.c

One way is that i should not include this file in creating library.In that
case c4.c willnot be compiled but i want c4.c to compile but not be included
in the library.

Also if i use add_custom_command to compile that file explicitly then i have
to give all the definitions and other compiler option settings for that file
explicitly which i dont want to do..

Is there any option in cmake while creating library which allows compiling a
file but not linking it in library.

Regards-
Ankit Jain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090526/d3eeab3a/attachment.htm>


More information about the CMake mailing list