[CMake] Settings different compile options for diff. files in same folder

ankit jain ankitguddu at gmail.com
Thu May 14 05:30:26 EDT 2009


---------- Forwarded message ----------
From: ankit jain <ankitguddu at gmail.com>
Date: 2009/5/14
Subject: Settings different compile options for diff. files in same folder..
To: cmake at cmake.org


Hi all,

I have a folder in which there are 5 files
folder
  a1.c
  a2.c
  a3.c
  a4.c
  a5.c

Out of these from 4th and 5th iam making a library if iam working on windows
else with the rest three iam building one library for the folder.
Even on windows also iam making this library but making one more library for
the files 4th and 5th.,.

Problem:::

Now the problem is that for the first three files i set certain macros and
certain CXX compile flags.
But for the 4th and 5th files i need not want these settings..
I want no macros and only two diff. compile flags /clr and /MD for compiling
these files and certain things for linking like /STCAK:value /NOENTRY
/NODEFUALTLIB:value

But when i am settings these using the set_source_files_properties the older
properties also exists there. they are not removed..

I dont understand how to remove old one and set new settings for these files
only,

Remember iam working on windows.(Visual studio .NET 2003)
when iam setting /clr  /RTC will not be there but since it is set earlier it
is not removed i dont know why...


What i need to do is this::(do not want previous settings of compiler flags
and linkage)

cl /clr /MD -I../include/ -m  -c perfdata.C
cl /clr /MD -I../include/ -m  -c perfinit.C

these are my 4th and 5th file as i mentioned..

 link /NOENTRY msvcrt.lib mscoree.lib kernel32.lib /DLL /STACK:0xC00000
/NODEFAULTLIB:nochkclr.obj
/INCLUDE:__DllMainCRTStartup at 12/OUT:liborchperfdatant.dll perfdata.o
perfinit.o


One more problem is there that is set the properties of files through the
set_source_files_properties and suppose i want to set two flags while
compiling like this:

set_source _files_properties(${source} PROPERTIES COMPILE_FLAGS /clr;/MD)

it does not taking it.. only one flag iam able to set not multiple flags..

One example if you give will give me great help..
Can anybody let me know how to do all these...
If any clarification required please let me know..

Regards-
ankit jain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090514/c0a663d7/attachment.htm>


More information about the CMake mailing list