Re: [CMake] creating static library with references to other .lib files

2007-06-12 Thread Jesper Eskilson

2007/6/12, Brandon Van Every <[EMAIL PROTECTED]>:



On some platforms, I bet the underlying linker AR can't even do it.  I
know it can't put static libraries inside of static libraries, thats' why
everyone wants "convenience libraries" and I had to work on all that object
file fakery.  Possibly it can't take a DLL stub .lib either.  So, if there
is a solution for some platforms, it's not likely to be portable.

I don't know what the MSVC linker can accomplish.  Would suggest reading
the MSVC docs to make sure it can be done.



I *know* that it can be done, since our current hand-written .vcproj files
do it. I simply want CMake to allow me to create a static library using a
command line such as:

lib /out:mystaticlib.lib foo.obj bar.obj mydll.lib

where mydll.lib is an import lib for mydll.dll.

What you're asking for seems kinda weird.  What's the motive?





foo.obj and bar.obj uses symbols in mydll.dll, and I want to allow users of
mystatic.lib to just have to link with mystaticlib.lib, and not with
mydll.lib.

Note that an import library on Windows *is* a static library (both having
the .lib suffix is not a coincidence). The only special thing with an import
library is that it exports symbols with a note that the symbol really should
be found at runtime in the given dll. So,

lib /out:foo.lib bar.obj fie.lib

puts all the contents of bar.obj and fie.lib into foo.lib. This is very
practical.

Hope that makes it a little clearer.

--
/Jesper
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Restoring a variable.. but only once!

2007-06-12 Thread Hendrik Sattler
Am Dienstag 12 Juni 2007 17:25 schrieb Vitor Vasconcelos Araujo Silva:
> > Have a look here at the _SET_FANCY macro:
> > http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/FindKDE4Internal.cm
> >ake?revision=668049&view=markup
> > http://www.cmake.org/mailman/listinfo/cmake
>
> Hello Alex and all,
>
>   I read it, but my case is a little bit different.
>   I wish to define the CMAKE_BUILD_TYPE as the default type. But I don't
> want to use the FORCE rule, because my users may want to change it. My
> problem is: I'm only able to put the "Release" value in ccmake interface
> if I force it... I'm using Cmake 2.4 patch 3. Any tips?

That's even in the FAQ:
http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_change_the_default_build_mode_and_see_it_reflected_in_the_GUI.3F

HS
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] [Dev] CMake 2.5 tool chain support example

2007-06-12 Thread Alexander Neundorf
On Tuesday 12 June 2007 16:21, Trevor Kellaway wrote:
> Alex,
>
> > I had another look at Freescale-chc12.cmake.
> >
> > I guess you have different projects using this controller ?
>
> Yes, each system will generally have its own custom link.prm.
>
> > In the file you have the cache variables HC12_LINK_PRM_FILE,
> > HC12_MEMORY_MODEL_LETTER and HC12_CORE. I guess they don't
> > depend on preferences of the users but on how the actual
> > hardware for this project looks like. Does this mean in order
> > to build these projects correctly the user/developer has to
> > adjust these variables manually to the correct values for the
> > target hardware ?
>
> The intention was to provide a default case, which will work for small
> programs, but in most cases this will be overridden.
> The layout is generally dependent on the software, data and functions
> can be placed in custom segments, which are then located based on
> link.prm.
>
> The HC12 has fixed on-chip resources, FLASH (typically 64KB to 512KB)
> and RAM (8KB to 32KB, yes KB not MB!), so in this case the hardware is
> fixed. It can has an optional external address bus, where you can

Not too long ago I also did some programming e.g. on a PIC16, which had 2k  
word program memory (2 k word != 2048 byte, since one word is 14 bit) and 256 
byte (not KB ! ;-) of RAM. 

> connect additional FLASH / RAM or peripherals, in this case the memory
> map is dependent on the project's hardware.

So, HC12_CORE is a hardware feature.
HC12_LINK_PRM_FILE mainly too, since the layout has to match the available 
memory.
HC12_MEMORY_MODEL_LETTER can then be selected.

> You're right, it would make more sense for Freescale-chc12-hc12.cmake to
> be included first, so this could act as an override for defaults in
> Freescale-chc12.cmake.

Usually you first set the defaults and then you override them with more 
specific settings, but this doesn't work for your case. Hmm.
I switched the order of the two in cvs for now, let's see how it works out.
Please try current cvs.

Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


RE: [CMake] [Dev] CMake 2.5 tool chain support example

2007-06-12 Thread Trevor Kellaway
Alex,

> I had another look at Freescale-chc12.cmake.
> 
> I guess you have different projects using this controller ?

Yes, each system will generally have its own custom link.prm.

> In the file you have the cache variables HC12_LINK_PRM_FILE, 
> HC12_MEMORY_MODEL_LETTER and HC12_CORE. I guess they don't 
> depend on preferences of the users but on how the actual 
> hardware for this project looks like. Does this mean in order 
> to build these projects correctly the user/developer has to 
> adjust these variables manually to the correct values for the 
> target hardware ?

The intention was to provide a default case, which will work for small
programs, but in most cases this will be overridden.

The layout is generally dependent on the software, data and functions
can be placed in custom segments, which are then located based on
link.prm.

The HC12 has fixed on-chip resources, FLASH (typically 64KB to 512KB)
and RAM (8KB to 32KB, yes KB not MB!), so in this case the hardware is
fixed. It can has an optional external address bus, where you can
connect additional FLASH / RAM or peripherals, in this case the memory
map is dependent on the project's hardware.


> If that's the case then IMO this is not ideal, this is what I 
> wanted to go to the Freescale-chc12-hc12.cmake file. But this 
> won't work (without repeating really a lot of code there) if 
> the "processor" file is executed after the "compiler" file, 
> because then the rules-variables will already have been set. 
> How about including the "processor" file before the "compiler" file ?
> Then you could have Freescale-chc12-product1.cmake which 
> would set HC12_CORE etc. as required for this project.

You're right, it would make more sense for Freescale-chc12-hc12.cmake to
be included first, so this could act as an override for defaults in
Freescale-chc12.cmake.

 - TrevK
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Set different compilation flags for specific file

2007-06-12 Thread James Bigler
Hi, is there something I'm missing here?  I can't get the changed flags to be 
applied to the library (ADD_LIBRARY(expon "ExponSSE.cc")).


James

James Bigler wrote:

I also tried making it its own library, but that didn't work:

ADD_LIBRARY(mylib ${source_files})

SET(CMAKE_CXX_FLAGS_RELEASE_SAVED ${CMAKE_CXX_FLAGS_RELEASE}  )
SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -g3"  )
ADD_LIBRARY(expon "ExponSSE.cc")
SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVED}  )

TARGET_LINK_LIBRARIES(mylib expon)

OUTPUT of make VERBOSE=1 (which is wrong).

[  0%] Building CXX object CMakeFiles/expon.dir/ExponSSE.o
/usr/bin/g++-4.0   -Dexpon_EXPORTS -msse -msse2 -DSCI_NOPERSISTENT 
-march=pentium4 -mtune=pentium4  -msse -msse2 -msse3 -mfpmath=sse  -O3 
-DNDEBUG -g3 -fgcse-sm -funroll-loops -fstrict-aliasing 
-fsched-interblock -ffast-math -freorder-blocks -fPIC 
-I/home/scinew/bigler/manta/rtsl/manta-test/opt 
-I/home/scinew/bigler/manta/rtsl/manta-test 
-I/home/sci/bigler/manta/trunk -I/home/sci/bigler/manta/trunk/SCIRun 
-I/home/sci/bigler/manta/trunk/SCIRun/include 
-I/home/sci/bigler/manta/trunk/opt-4.0.2/include   -o 
CMakeFiles/expon.dir/ExponSSE.o -c 
/home/scinew/bigler/manta/rtsl/manta-test/ExponSSE.cc


===
I put MESSAGE statements around, and it looks like it is changing 
CMAKE_CXX_FLAGS_RELEASE.  Is there something I'm missing?


James Bigler wrote:

So I can't set this for a single source file, but rather a library?

Can I add additional sources to the library after I added the library:

ADD_LIBRARY(mylib ${other_sources})
SET(CMAKE_CXX_FLAGS_RELEASE_SAVED ${CMAKE_CXX_FLAGS_RELEASE}  )
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )
ADD_LIBRARY(mylib ${special_file})
SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVED}  )

This didn't seem to work.

James

Rob Mathews wrote:

Put it in that one file like this:
SET(CMAKE_CXX_FLAGS_RELEASE_SAVED ${CMAKE_CXX_FLAGS_RELEASE}  )
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )
.. add the library or target
SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVED}  )

-Original Message-
From: James Bigler [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 
12, 2007 1:38 PM

To: Rob Mathews
Cc: cmake@cmake.org
Subject: Re: [CMake] Set different compilation flags for specific file

Wouldn't that set it for all the source files in the project?  I just
want to override 1 file amongst many others.

Rob Mathews wrote:

Why wouldn't you simply do this:

SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )

(or whatever your particular flags are)
?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of

James

Bigler
Sent: Tuesday, June 12, 2007 1:14 PM
To: cmake@cmake.org
Subject: [CMake] Set different compilation flags for specific file

I have a file that doesn't compile properly with certain optimization
flags that I wish to use on the rest of my system.  I poked around 
the wiki and

the

help file, but I can't find any information on how to do this.

According to the documentation SET_SOURCE_FILES_PROPERTIES

COMPILE_FLAGS
only appends new flags.  I want to override the values in 
CMAKE_CXX_FLAGS

and

CMAKE_CXX_FLAGS_RELEASE.

Thanks,
James
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake






___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] C# support again

2007-06-12 Thread Joshua Jensen

Brandon Van Every wrote:

On 6/9/07, Joshua Jensen <[EMAIL PROTECTED]> wrote:

What is Kitware's interest in full Visual Studio C# support in CMake?

10 months ago, Brad King wrote in
http://public.kitware.com/pipermail/cmake/2006-August/010528.html

is there any development (planned) on C# (Csharp) support for CMake ?

Currently there are no plans to develop support ourselves to my
knowledge.  If someone volunteers to add it we will accept the
contribution.  If you want to do this we can get you started.
Well, then, it looks like the interest is there.  Perhaps I'll start 
looking into it more seriously then.


Josh
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] [Dev] CMake 2.5 tool chain support example

2007-06-12 Thread Alexander Neundorf
On Sunday 10 June 2007 17:38, Trevor Kellaway wrote:
> Note that in my example Freescale.cmake and Freescale-chc12-hc12.cmake
> are effectively empty, as all content seems to logically belong in
> Freescale-chc12.cmake in this case.

I had another look at Freescale-chc12.cmake.

I guess you have different projects using this controller ?

In the file you have the cache variables HC12_LINK_PRM_FILE, 
HC12_MEMORY_MODEL_LETTER and HC12_CORE. I guess they don't depend on 
preferences of the users but on how the actual hardware for this project 
looks like. Does this mean in order to build these projects correctly the 
user/developer has to adjust these variables manually to the correct values 
for the target hardware ?

If that's the case then IMO this is not ideal, this is what I wanted to go to 
the Freescale-chc12-hc12.cmake file. But this won't work (without repeating 
really a lot of code there) if the "processor" file is executed after 
the "compiler" file, because then the rules-variables will already have been 
set. 
How about including the "processor" file before the "compiler" file ?
Then you could have Freescale-chc12-product1.cmake which would set HC12_CORE 
etc. as required for this project.

What do you think ?

Bye
Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Set different compilation flags for specific file

2007-06-12 Thread James Bigler

I also tried making it its own library, but that didn't work:

ADD_LIBRARY(mylib ${source_files})

SET(CMAKE_CXX_FLAGS_RELEASE_SAVED ${CMAKE_CXX_FLAGS_RELEASE}  )
SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -g3"  )
ADD_LIBRARY(expon "ExponSSE.cc")
SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVED}  )

TARGET_LINK_LIBRARIES(mylib expon)

OUTPUT of make VERBOSE=1 (which is wrong).

[  0%] Building CXX object CMakeFiles/expon.dir/ExponSSE.o
/usr/bin/g++-4.0   -Dexpon_EXPORTS -msse -msse2 -DSCI_NOPERSISTENT 
-march=pentium4 -mtune=pentium4  -msse -msse2 -msse3 -mfpmath=sse  -O3 -DNDEBUG 
-g3 -fgcse-sm -funroll-loops -fstrict-aliasing -fsched-interblock -ffast-math 
-freorder-blocks -fPIC -I/home/scinew/bigler/manta/rtsl/manta-test/opt 
-I/home/scinew/bigler/manta/rtsl/manta-test -I/home/sci/bigler/manta/trunk 
-I/home/sci/bigler/manta/trunk/SCIRun 
-I/home/sci/bigler/manta/trunk/SCIRun/include 
-I/home/sci/bigler/manta/trunk/opt-4.0.2/include   -o 
CMakeFiles/expon.dir/ExponSSE.o -c 
/home/scinew/bigler/manta/rtsl/manta-test/ExponSSE.cc


===
I put MESSAGE statements around, and it looks like it is changing 
CMAKE_CXX_FLAGS_RELEASE.  Is there something I'm missing?


James Bigler wrote:

So I can't set this for a single source file, but rather a library?

Can I add additional sources to the library after I added the library:

ADD_LIBRARY(mylib ${other_sources})
SET(CMAKE_CXX_FLAGS_RELEASE_SAVED ${CMAKE_CXX_FLAGS_RELEASE}  )
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )
ADD_LIBRARY(mylib ${special_file})
SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVED}  )

This didn't seem to work.

James

Rob Mathews wrote:

Put it in that one file like this:
SET(CMAKE_CXX_FLAGS_RELEASE_SAVED ${CMAKE_CXX_FLAGS_RELEASE}  )
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )
.. add the library or target
SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVED}  )

-Original Message-
From: James Bigler [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 12, 
2007 1:38 PM

To: Rob Mathews
Cc: cmake@cmake.org
Subject: Re: [CMake] Set different compilation flags for specific file

Wouldn't that set it for all the source files in the project?  I just
want to override 1 file amongst many others.

Rob Mathews wrote:

Why wouldn't you simply do this:

SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )

(or whatever your particular flags are)
?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of

James

Bigler
Sent: Tuesday, June 12, 2007 1:14 PM
To: cmake@cmake.org
Subject: [CMake] Set different compilation flags for specific file

I have a file that doesn't compile properly with certain optimization
flags that I wish to use on the rest of my system.  I poked around 
the wiki and

the

help file, but I can't find any information on how to do this.

According to the documentation SET_SOURCE_FILES_PROPERTIES

COMPILE_FLAGS
only appends new flags.  I want to override the values in 
CMAKE_CXX_FLAGS

and

CMAKE_CXX_FLAGS_RELEASE.

Thanks,
James
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake






___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] add_definitions & "string" values

2007-06-12 Thread Bill Hoffman

Filip Brcic wrote:


Yes, and for increased readability, I would suggest you to use:

add_definitions(-DFOO="\\"foo\\"")

so that you get

gcc -DFOO="\"foo\"" yourfile.c

when CMake compiles your file and, obviously, FOO="foo" in C.

On the sidenote, how does that relate to various shells? I'm using bash, but 
did anybody cases with escapes like this one in other shells such as csh, 
zsh, {,d}ash, or Micro$oft's favourite - ksh?
  

Of course a better way to do that IMO, is to configure a file.

#cmakedefine FOO "@somevalue@"

That way there are no shell issues.

-bill

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


RE: [CMake] Set different compilation flags for specific file

2007-06-12 Thread Rob Mathews
No that doesn't work. 

Well ... you could start out by setting CMAKE_CXX_FLAGS_RELEASE to ""
and then using the SET_SOURCE_FILES_PROPERTIES to add the flags you need
to every file .. the file that 

SET(CMAKE_CXX_FLAGS_RELEASE_SAVED ${CMAKE_CXX_FLAGS_RELEASE}  )
SET(CMAKE_CXX_FLAGS_RELEASE ""  )

then for more of the files do this: 

SET_SOURCE_FILES_PROPERTIES COMPILE_FLAGS ${CMAKE_CXX_FLAGS_RELEASE}) 

except for the one file where you want the special flags: 
SET_SOURCE_FILES_PROPERTIES COMPILE_FLAGS "special set of flags")


and then restore CMAKE_CXX_FLAGS_RELEASE for the rest of the system
build: 

SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVED}  )


-Original Message-
From: James Bigler [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 12, 2007 2:09 PM
To: Rob Mathews
Cc: cmake@cmake.org
Subject: Re: [CMake] Set different compilation flags for specific file

So I can't set this for a single source file, but rather a library?

Can I add additional sources to the library after I added the library:

ADD_LIBRARY(mylib ${other_sources})
SET(CMAKE_CXX_FLAGS_RELEASE_SAVED ${CMAKE_CXX_FLAGS_RELEASE}  )
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )
ADD_LIBRARY(mylib ${special_file})
SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVED}  )

This didn't seem to work.

James

Rob Mathews wrote:
> Put it in that one file like this: 
> 
> SET(CMAKE_CXX_FLAGS_RELEASE_SAVED ${CMAKE_CXX_FLAGS_RELEASE}  )
> SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )
> .. add the library or target
> SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVED}  )
> 
> -Original Message-
> From: James Bigler [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, June 12, 2007 1:38 PM
> To: Rob Mathews
> Cc: cmake@cmake.org
> Subject: Re: [CMake] Set different compilation flags for specific file
> 
> Wouldn't that set it for all the source files in the project?  I just
> want to 
> override 1 file amongst many others.
> 
> Rob Mathews wrote:
>> Why wouldn't you simply do this:
>>
>> SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )
>>
>> (or whatever your particular flags are)
>> ? 
>>
>>
>> -Original Message-
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] On Behalf Of
> James
>> Bigler
>> Sent: Tuesday, June 12, 2007 1:14 PM
>> To: cmake@cmake.org
>> Subject: [CMake] Set different compilation flags for specific file
>>
>> I have a file that doesn't compile properly with certain optimization
>> flags that 
>> I wish to use on the rest of my system.  I poked around the wiki and
> the
>> help 
>> file, but I can't find any information on how to do this.
>>
>> According to the documentation SET_SOURCE_FILES_PROPERTIES
> COMPILE_FLAGS
>> only 
>> appends new flags.  I want to override the values in CMAKE_CXX_FLAGS
> and
>> CMAKE_CXX_FLAGS_RELEASE.
>>
>> Thanks,
>> James
>> ___
>> CMake mailing list
>> CMake@cmake.org
>> http://www.cmake.org/mailman/listinfo/cmake
>>
>>
> 
> 


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Set different compilation flags for specific file

2007-06-12 Thread James Bigler

So I can't set this for a single source file, but rather a library?

Can I add additional sources to the library after I added the library:

ADD_LIBRARY(mylib ${other_sources})
SET(CMAKE_CXX_FLAGS_RELEASE_SAVED ${CMAKE_CXX_FLAGS_RELEASE}  )
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )
ADD_LIBRARY(mylib ${special_file})
SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVED}  )

This didn't seem to work.

James

Rob Mathews wrote:
Put it in that one file like this: 


SET(CMAKE_CXX_FLAGS_RELEASE_SAVED ${CMAKE_CXX_FLAGS_RELEASE}  )
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )
.. add the library or target
SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVED}  )

-Original Message-
From: James Bigler [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 12, 2007 1:38 PM

To: Rob Mathews
Cc: cmake@cmake.org
Subject: Re: [CMake] Set different compilation flags for specific file

Wouldn't that set it for all the source files in the project?  I just
want to 
override 1 file amongst many others.


Rob Mathews wrote:

Why wouldn't you simply do this:

SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )

(or whatever your particular flags are)
? 



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of

James

Bigler
Sent: Tuesday, June 12, 2007 1:14 PM
To: cmake@cmake.org
Subject: [CMake] Set different compilation flags for specific file

I have a file that doesn't compile properly with certain optimization
flags that 
I wish to use on the rest of my system.  I poked around the wiki and

the
help 
file, but I can't find any information on how to do this.


According to the documentation SET_SOURCE_FILES_PROPERTIES

COMPILE_FLAGS
only 
appends new flags.  I want to override the values in CMAKE_CXX_FLAGS

and

CMAKE_CXX_FLAGS_RELEASE.

Thanks,
James
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake






___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


RE: [CMake] Set different compilation flags for specific file

2007-06-12 Thread Rob Mathews
Put it in that one file like this: 

SET(CMAKE_CXX_FLAGS_RELEASE_SAVED ${CMAKE_CXX_FLAGS_RELEASE}  )
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )
.. add the library or target
SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVED}  )

-Original Message-
From: James Bigler [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 12, 2007 1:38 PM
To: Rob Mathews
Cc: cmake@cmake.org
Subject: Re: [CMake] Set different compilation flags for specific file

Wouldn't that set it for all the source files in the project?  I just
want to 
override 1 file amongst many others.

Rob Mathews wrote:
> Why wouldn't you simply do this:
> 
> SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )
> 
> (or whatever your particular flags are)
> ? 
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
James
> Bigler
> Sent: Tuesday, June 12, 2007 1:14 PM
> To: cmake@cmake.org
> Subject: [CMake] Set different compilation flags for specific file
> 
> I have a file that doesn't compile properly with certain optimization
> flags that 
> I wish to use on the rest of my system.  I poked around the wiki and
the
> help 
> file, but I can't find any information on how to do this.
> 
> According to the documentation SET_SOURCE_FILES_PROPERTIES
COMPILE_FLAGS
> only 
> appends new flags.  I want to override the values in CMAKE_CXX_FLAGS
and
> 
> CMAKE_CXX_FLAGS_RELEASE.
> 
> Thanks,
> James
> ___
> CMake mailing list
> CMake@cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
> 
> 


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] add_definitions & "string" values

2007-06-12 Thread Filip Brcic
Дана уторак 12 јун 2007, Alexander Neundorf је написао(ла):
> On Tuesday 12 June 2007 12:38, Welter Luigi Silva wrote:
> > Hi again,
> > I'm trying to have a definition with a string value, say, "foo".
> > However, when I tried the following command:
> >
> > add_definitions(-DFOO="foo")
> >
> > and used FOO in my source file -- in a command like printf("%s\n", FOO)
> > -- I got 'foo' without the quotes, which is not a valid string literal,
> > as I wished it was.
> > I've also tried the command bellow but it did not work as well:
> > add_definitions(-DFOO="\"foo\"")
>
> You need more escaping, the following should work:
> add_definitions(-DFOO=\\"foo\\")

Yes, and for increased readability, I would suggest you to use:

add_definitions(-DFOO="\\"foo\\"")

so that you get

gcc -DFOO="\"foo\"" yourfile.c

when CMake compiles your file and, obviously, FOO="foo" in C.

On the sidenote, how does that relate to various shells? I'm using bash, but 
did anybody cases with escapes like this one in other shells such as csh, 
zsh, {,d}ash, or Micro$oft's favourite - ksh?

Filip

-- 
Filip Brcic <[EMAIL PROTECTED]>
WWWeb: http://purl.org/NET/brcha/home/
Jabber: [EMAIL PROTECTED]
Jabber: [EMAIL PROTECTED]
Jabber: [EMAIL PROTECTED]
ICQ# 40994923
Yahoo! brcha
MSN: [EMAIL PROTECTED]
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Set different compilation flags for specific file

2007-06-12 Thread James Bigler
Wouldn't that set it for all the source files in the project?  I just want to 
override 1 file amongst many others.


Rob Mathews wrote:

Why wouldn't you simply do this:

SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )

(or whatever your particular flags are)
? 



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of James
Bigler
Sent: Tuesday, June 12, 2007 1:14 PM
To: cmake@cmake.org
Subject: [CMake] Set different compilation flags for specific file

I have a file that doesn't compile properly with certain optimization
flags that 
I wish to use on the rest of my system.  I poked around the wiki and the
help 
file, but I can't find any information on how to do this.


According to the documentation SET_SOURCE_FILES_PROPERTIES COMPILE_FLAGS
only 
appends new flags.  I want to override the values in CMAKE_CXX_FLAGS and


CMAKE_CXX_FLAGS_RELEASE.

Thanks,
James
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


RE: [CMake] Set different compilation flags for specific file

2007-06-12 Thread Rob Mathews
Why wouldn't you simply do this:

SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )

(or whatever your particular flags are)
? 


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of James
Bigler
Sent: Tuesday, June 12, 2007 1:14 PM
To: cmake@cmake.org
Subject: [CMake] Set different compilation flags for specific file

I have a file that doesn't compile properly with certain optimization
flags that 
I wish to use on the rest of my system.  I poked around the wiki and the
help 
file, but I can't find any information on how to do this.

According to the documentation SET_SOURCE_FILES_PROPERTIES COMPILE_FLAGS
only 
appends new flags.  I want to override the values in CMAKE_CXX_FLAGS and

CMAKE_CXX_FLAGS_RELEASE.

Thanks,
James
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Set different compilation flags for specific file

2007-06-12 Thread James Bigler
I have a file that doesn't compile properly with certain optimization flags that 
I wish to use on the rest of my system.  I poked around the wiki and the help 
file, but I can't find any information on how to do this.


According to the documentation SET_SOURCE_FILES_PROPERTIES COMPILE_FLAGS only 
appends new flags.  I want to override the values in CMAKE_CXX_FLAGS and 
CMAKE_CXX_FLAGS_RELEASE.


Thanks,
James
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cache variables

2007-06-12 Thread David Cole

This line:
SET (CMAKE_BUILD_TYPE "Release" CACHE TYPE STRING)

should be:
SET (CMAKE_BUILD_TYPE "Release" CACHE STRING "documentation string here")

You are trying to specify "TYPE" as the type of the varibale


HTH,
David



On 6/12/07, Vitor Vasconcelos Araujo Silva <[EMAIL PROTECTED]> wrote:


Hi all,

I'm having a strange problem with my variables. In the root of my
project (that builds two libs and few executables), I have those
definitions:

SET (CMAKE_BUILD_TYPE "Release" CACHE TYPE STRING)

IF (WIN32)
   # WARNING: The configuration type only works for make based generators.
   SET(CMAKE_CONFIGURATION_TYPES "Release" CACHE STRING
   "The Windows version is built only in RELEASE version" FORCE)
   SET(CMAKE_CXX_WARNING_LEVEL "0" CACHE STRING "No WARNINGS on
Windows"FORCE)
ENDIF(WIN32)

When I execute it on Linux, everything goes fine, except the
CMAKE_BUILD_TYPE variable remains untouched.

On Windows, this variable is set! (and I don't need it). But the
stranger is: the CMAKE_CONFIGURATION_TYPES is kept with all possible
configurations (the default, I suppose), even with the FORCE parameter.
However, the CMAKE_CXX_WARNING_LEVEL is set to zero correctly.

Anybody has a clue about this? I always bet I can be doing
something
wrong. But, what?
Thanks a lot,

Vitor

p.s.: I'm using Cmake 2.4 patch 3

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] add_definitions & "string" values

2007-06-12 Thread Alexander Neundorf
On Tuesday 12 June 2007 12:38, Welter Luigi Silva wrote:
> Hi again,
> I'm trying to have a definition with a string value, say, "foo".
> However, when I tried the following command:
>
> add_definitions(-DFOO="foo")
>
> and used FOO in my source file -- in a command like printf("%s\n", FOO) --
> I got 'foo' without the quotes, which is not a valid string literal, as
> I wished it was.
> I've also tried the command bellow but it did not work as well:
> add_definitions(-DFOO="\"foo\"")

You need more escaping, the following should work:
add_definitions(-DFOO=\\"foo\\")

Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Cache variables

2007-06-12 Thread Vitor Vasconcelos Araujo Silva

Hi all,

	I'm having a strange problem with my variables. In the root of my 
project (that builds two libs and few executables), I have those 
definitions:


SET (CMAKE_BUILD_TYPE "Release" CACHE TYPE STRING)

IF (WIN32)
  # WARNING: The configuration type only works for make based generators.
  SET(CMAKE_CONFIGURATION_TYPES "Release" CACHE STRING
  "The Windows version is built only in RELEASE version" FORCE)
  SET(CMAKE_CXX_WARNING_LEVEL "0" CACHE STRING "No WARNINGS on 
Windows" 	FORCE)

ENDIF(WIN32)

	When I execute it on Linux, everything goes fine, except the 
CMAKE_BUILD_TYPE variable remains untouched.


	On Windows, this variable is set! (and I don't need it). But the 
stranger is: the CMAKE_CONFIGURATION_TYPES is kept with all possible 
configurations (the default, I suppose), even with the FORCE parameter.

However, the CMAKE_CXX_WARNING_LEVEL is set to zero correctly.

	Anybody has a clue about this? I always bet I can be doing something 
wrong. But, what?

Thanks a lot,

Vitor

p.s.: I'm using Cmake 2.4 patch 3

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Restoring a variable.. but only once!

2007-06-12 Thread David Cole

Use "pairs of values", where you provide a named value that CMake does not
know anything about... Then use that value to force the cache value of the
variable that CMake does know about...

As in:
PROJECT(whatever CXX)

SET(MY_CMAKE_BUILD_TYPE "Debug" CACHE STRING "User settable value always
forces CMAKE_BUILD_TYPE value...")
SET(CMAKE_BUILD_TYPE "${MY_CMAKE_BUILD_TYPE}" CACHE INTERNAL "Internal
setting always contains value of MY_CMAKE_BUILD_TYPE..." FORCE)
MESSAGE(STATUS "MY_CMAKE_BUILD_TYPE='${MY_CMAKE_BUILD_TYPE}'")
MESSAGE(STATUS "CMAKE_BUILD_TYPE='${CMAKE_BUILD_TYPE}'")

SET(MY_SETTABLE_VALUE "can be set to anything..." CACHE STRING "User
settable value always forces UNSETTABLE_VALUE value...")
SET(UNSETTABLE_VALUE "${MY_SETTABLE_VALUE}" CACHE INTERNAL "Internal setting
always contains value of MY_SETTABLE_VALUE..." FORCE)
MESSAGE(STATUS "MY_SETTABLE_VALUE='${MY_SETTABLE_VALUE}'")
MESSAGE(STATUS "UNSETTABLE_VALUE='${UNSETTABLE_VALUE}'")


Good luck -- HTH,
David


On 6/12/07, Vitor Vasconcelos Araujo Silva <[EMAIL PROTECTED]> wrote:



> Have a look here at the _SET_FANCY macro:
>
http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/FindKDE4Internal.cmake?revision=668049&view=markup
> http://www.cmake.org/mailman/listinfo/cmake

Hello Alex and all,

I read it, but my case is a little bit different.
I wish to define the CMAKE_BUILD_TYPE as the default type. But I
don't
want to use the FORCE rule, because my users may want to change it. My
problem is: I'm only able to put the "Release" value in ccmake interface
if I force it... I'm using Cmake 2.4 patch 3. Any tips?
Thanks.

Vitor Vasconcelos

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Antwort: Re: [CMake] how to automatically make object from generated source?

2007-06-12 Thread Jens . M . Hoffmann




> > ADD_CUSTOM_TARGET( dummy ALL DEPENDS ${src_dir}/admin/clean )
>
> I suggested dummy, but you should really use another name. Take for
> instance the name of the executable, it will add a nicer target (more

ah yes, thanks for the hint.

> representativ) in your makefile. As a

I think, I'missing a part of your reply. Could you please send it again?

> > What I'm now getting is the following error message:

Regards,
Jens-Michael





-

Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte
Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die
unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorised copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

--___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

[CMake] add_definitions & "string" values

2007-06-12 Thread Welter Luigi Silva

Hi again,
I'm trying to have a definition with a string value, say, "foo".
However, when I tried the following command:

add_definitions(-DFOO="foo")

and used FOO in my source file -- in a command like printf("%s\n", FOO) --
I got 'foo' without the quotes, which is not a valid string literal, as 
I wished it was.

I've also tried the command bellow but it did not work as well:
add_definitions(-DFOO="\"foo\"")

So, how do I define this correctly in a CMakeList.txt file?

thx,
Welter
p.s.: hope this question is not so dumb as my previous one :-)

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Generating dynamic libraries

2007-06-12 Thread Welter Luigi Silva

Alan W. Irwin wrote:

You can generate a shared library with ADD_LIBRARY.  See the ADD_LIBRARY
documentation at http://cmake.org/HTML/Documentation.html.

Yeah, indeed. Sorry for my stupidness.
thx,
Welter
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake VS .net 2003 C++ properties missing

2007-06-12 Thread gga
[EMAIL PROTECTED] wrote:
> 
> Is there something that I can do to correct this? Am I doing something
> wrong? In digging around, I have not seen anything that indicates I need
> to do anything different when generating a VS .net 2003 solution from
> CMake.
> 

This seems to be a bug in VS .net that gets triggered by CMake for some
weird reason.  I had the same issue.  I solved it by:

Going to the properties of the main project (ie. solution).  Usually
that one will contain the C++ properties.  After the panel appears,
switching to other projects will make the panel will also show up in the
other projects.  At least that worked for me.


-- 
Gonzalo Garramuño
[EMAIL PROTECTED]

AMD4400 - ASUS48N-E
GeForce7300GT
Kubuntu Edgy
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Generating dynamic libraries

2007-06-12 Thread Alan W. Irwin

On 2007-06-12 12:37-0300 Welter Luigi Silva wrote:


Hi,
which is the command I should use (instead of add_library) to generate a 
shared library using CMake?
Sorry if this is a dumb question, but I'm a newbie on this and didn't find 
any documentation about that in the Cmake faq or wiki pages...

thx,


You can generate a shared library with ADD_LIBRARY.  See the ADD_LIBRARY
documentation at http://cmake.org/HTML/Documentation.html.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__

Linux-powered Science
__
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Generating dynamic libraries

2007-06-12 Thread Welter Luigi Silva

Hi,
which is the command I should use (instead of add_library) to generate a 
shared library using CMake?
Sorry if this is a dumb question, but I'm a newbie on this and didn't 
find any documentation about that in the Cmake faq or wiki pages...

thx,
Welter


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Generating dynamic libraries

2007-06-12 Thread Brandon Van Every

On 6/12/07, Welter Luigi Silva <[EMAIL PROTECTED]> wrote:

Hi,
which is the command I should use (instead of add_library) to generate a
shared library using CMake?


Why would you use a command "instead of" ADD_LIBRARY?  Have you read the docs?


Sorry if this is a dumb question, but I'm a newbie on this and didn't
find any documentation about that in the Cmake faq or wiki pages...


Do you know where the docs are located?  I'm not saying it to be
critical, I'm just looking for justifications for bug #3907, "Windows
Start menu links for online documentation."  Are you using Windows?


Cheers,
Brandon Van Every
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Adding multiple times the same target. How to make it clean ?

2007-06-12 Thread Asmodehn Shade
Hi everyone,

I have been using cmake for quite a while now. I am using 2.4.6 on NetBSD.
Among other things I do a dependency build automatically, based on a well-known 
directory
tree.

For example lets say you have :

CMakeLists.txt
Source1.c
depends/subprojA/
depends/subprojA/CMakeLists.txt - defining a new project that can be used 
separately.
depends/subprojA/SourceSubprojA.c

This works well.

My problem arise when I want to have two or more main targets ( lets say you 
add Source2.c to the previous example ) to get two executables using the same 
library for example.
The depends target gets cmake'd twice by the following code as expected ( 
simplified a lot because I do that in more complex generic cmake scripts ):

[...snip...]
MACRO (Build)
FOREACH ( looparg ${ARGN} )

GET_FILENAME_COMPONENT(exename ${looparg} NAME_WE )
ADD_EXECUTABLE(${exename} ${looparg})
ADD_SUBDIRECTORY(depends/subprojA depends/subprojA_build 
EXCLUDE_FROM_ALL)
TARGET_LINK_LIBRARIES(${exename} subprojA)
ADD_DEPENDENCIES(${exename} subprojA)

ENDFOREACH ( looparg )
ENDMACRO (BuildDepends)
[...snip...]
FILE ( GLOB sourcelist ${CMAKE_SOURCE_DIR} *.c)
Build( ${sourcelist} )
[...snip...]

And cmake gives me lots of warnings :
make: "CMakeFiles/CMakeFiles/Makefile2" line 402: warning: duplicate script for 
target "depends/subprojA_build/CMakeFiles/subprojA.dir/all" ignored
make: "CMakeFiles/CMakeFiles/Makefile2" line 250: warning: using previous 
script for "depends/subprojA_build/CMakeFiles/subprojA.dir/all" defined here
Although it works ;)

What I need to do is : Not to do the ADD_SUBDIRECTORY if this subdirectory has 
just been cmaked, *_without_* taking the ADD_SUBDIRECTORY out of the loop or 
out of the macro of course ;)
My actual macro is more complex and provide a way to build and link custom 
dependencies only if needed. But I dont know how to check this dependency has 
been already made in this cmake call.
I just want to avoid the cmaking of it if possible, to avoid the warnings... 
The build will still run fine.

So I wonder if there is a way to check if a target has already been added ? how 
can I get the list of target ?
Can do a check on the subdirectory to make sure I just entered it for the first 
time in this " $ cmake sourcedir " call ?
Maybe another way to check something that will be enough so that I am assured 
that depends/subprojectA will be built once and once only if needed ?
I know I could build it manually, but I still want depends/subprojectA to build 
automatically with only one "cmake . && make" call

I can provide you with my cmake scripts, but I think it will be more of a 
trouble than a help to solve this little problem, probably coming of my lack of 
knowledge.
They are available here anyway if you want them : 
https://asmodehn.fr/trac/Workshop/browser/trunk/CMake although probably not the 
last version I am talking about here.
I hope I have been clear enough on my problem ;) Dont hesitate to ask me more 
questions if you want more informations.

Thank you very much for your help :)

--
Asmodehn
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Restoring a variable.. but only once!

2007-06-12 Thread Vitor Vasconcelos Araujo Silva



Have a look here at the _SET_FANCY macro:
http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/FindKDE4Internal.cmake?revision=668049&view=markup
http://www.cmake.org/mailman/listinfo/cmake


   Hello Alex and all,

I read it, but my case is a little bit different.
	I wish to define the CMAKE_BUILD_TYPE as the default type. But I don't 
want to use the FORCE rule, because my users may want to change it. My 
problem is: I'm only able to put the "Release" value in ccmake interface 
if I force it... I'm using Cmake 2.4 patch 3. Any tips?

Thanks.

Vitor Vasconcelos

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] creating static library with references to other .lib files

2007-06-12 Thread Brandon Van Every

On 6/12/07, Jesper Eskilson <[EMAIL PROTECTED]> wrote:




2007/6/7, Jesper Eskilson <[EMAIL PROTECTED]>:
>
>
>
> 2007/6/7, Brandon Van Every < [EMAIL PROTECTED]>:
> >
> > On 6/7/07, Jesper Eskilson < [EMAIL PROTECTED]> wrote:
> > > Hi all,
> > >
> > > I would like to be able to create a static library on Windows which
> > > includes an import library to a DLL, so that users of the static
> > > library do not need to specify the import library.
> >
> >
I'm still interested in a solution to my original problem, though.




On some platforms, I bet the underlying linker AR can't even do it.  I know
it can't put static libraries inside of static libraries, thats' why
everyone wants "convenience libraries" and I had to work on all that object
file fakery.  Possibly it can't take a DLL stub .lib either.  So, if there
is a solution for some platforms, it's not likely to be portable.

I don't know what the MSVC linker can accomplish.  Would suggest reading the
MSVC docs to make sure it can be done.

What you're asking for seems kinda weird.  What's the motive?


Cheers,
Brandon Van Every
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

[Fwd: Re: [CMake] Creating static executables]

2007-06-12 Thread Bill Hoffman


--- Begin Message ---
Thanks, that fixed the problem.

Regards,

Ajay

On Tuesday 12 June 2007 10:23, you wrote:
> Ajay Divekar wrote:
> > Bill,
> > Before I give out the actual command here is the CmakeList.txt file that
> > I am using to generate the makefile. This is FreeBSD 5.5
> >
> > LINK_DIRECTORIES ($ENV{PP_ROOTDIR}/lib .)
> > ADD_EXECUTABLE (IANd IANd.c IANServer.c IANProcess.cc )
> > SET_TARGET_PROPERTIES (IANd PROPERTIES LINK_FLAGS "-L/usr/local/lib/
> > -L/usr/lib")
> > SET (CMAKE_EXE_LINK_DYNAMIC_C_FLAGS "-Wl,-Bstatic")
> > TARGET_LINK_LIBRARIES (IANd PSutils PSconfig GSF ShMem CLog PDTPClient
> > ImgIO ImgUtil ImgVal ImgBase ${IPP_LIB1} ${IPP_LIB2} ${IPP_LIB3}
> > ${IPP_LIB4} ${IPP_LIB5} PSDebug PDTPClient libtiff.a libjpeg.a libz.a)
> >
> > Here is the actual command that is being executed
> >
> > cd /usr/home/ajayd/CMakeProject/src/IAN && /usr/local/bin/g++34 -O3
> > -DNDEBUG  -fPIC -L/usr/local/lib/ -L/usr/lib "CMakeFiles/IANd.dir/IANd.o"
> > "CMakeFiles/IANd.dir/IANServer.o"  "CMakeFiles/IANd.dir/IANProcess.o"  
> > -o IANd  -L/usr/home/ajayd/CMakeProject/lib -L.
>
> You need to set CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS as well as C flag, if
> you notice
> it is using g++34 for the compiler to link with.  This is because of the
> .cc file you have in the executable.
>
> -Bill

-- 
Ajay Divekar
System Developer
Guardian Technologies International
Tel No : 703-481-4882

--- End Message ---
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] visual studio converter?

2007-06-12 Thread Jesper Eskilson

2007/6/12, Alexander Neundorf <[EMAIL PROTECTED]>:

Hi Jesper,

On Thursday 07 June 2007 08:38, Jesper Eskilson wrote:
...
> I've written a simple hack in Ruby which extracts the most vital parts of a
> .vcproj file and generates a corresponding CMakeLists.txt. There are a lot
> of things it doesn't handle (custom build steps, multiple configurations,
> etc.), but its a good starting point.
>
> Feel free to use it; but I make no guarantees. It shouldn't wipe your
> harddrive, though. I hope. ;-)

can you please put this converter or a link to it in the cmake wiki ?
It should go in this section:
http://www.cmake.org/Wiki/CMake#Converters_from_other_buildsystems_to_CMake


Done.

--
/Jesper
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Creating static executables

2007-06-12 Thread Bill Hoffman

Ajay Divekar wrote:

Bill,
Before I give out the actual command here is the CmakeList.txt file that I am 
using to generate the makefile. This is FreeBSD 5.5


LINK_DIRECTORIES ($ENV{PP_ROOTDIR}/lib .)
ADD_EXECUTABLE (IANd IANd.c IANServer.c IANProcess.cc )
SET_TARGET_PROPERTIES (IANd PROPERTIES LINK_FLAGS "-L/usr/local/lib/ 
-L/usr/lib")

SET (CMAKE_EXE_LINK_DYNAMIC_C_FLAGS "-Wl,-Bstatic")
TARGET_LINK_LIBRARIES (IANd PSutils PSconfig GSF ShMem CLog PDTPClient ImgIO 
ImgUtil ImgVal ImgBase ${IPP_LIB1} ${IPP_LIB2} ${IPP_LIB3} ${IPP_LIB4} 
${IPP_LIB5} PSDebug PDTPClient libtiff.a libjpeg.a libz.a)


Here is the actual command that is being executed

cd /usr/home/ajayd/CMakeProject/src/IAN && /usr/local/bin/g++34 -O3 
-DNDEBUG  -fPIC -L/usr/local/lib/ -L/usr/lib "CMakeFiles/IANd.dir/IANd.o"  
"CMakeFiles/IANd.dir/IANServer.o"  "CMakeFiles/IANd.dir/IANProcess.o"   -o 
IANd  -L/usr/home/ajayd/CMakeProject/lib -L. 
  
You need to set CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS as well as C flag, if 
you notice
it is using g++34 for the compiler to link with.  This is because of the 
.cc file you have in the executable.


-Bill




___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Changing the include switch

2007-06-12 Thread John Donovan
- Original Message - 
From: "John Donovan" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, June 12, 2007 1:40 PM
Subject: [CMake] Changing the include switch


An alternative is to provide the -gccincludes switch to the compiler 
commandline _before_ the -I switches, but CMake puts the includes first, 
then the definitions and COMPILE_FLAGS property.


Fixed it. I found the property CMAKE_C_FLAGS, which gets put immediately 
after the compiler executable and before everything else.


John Donovan - Programmer, TT Fusion Ltd.



__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] visual studio converter?

2007-06-12 Thread Alexander Neundorf
Hi Jesper,

On Thursday 07 June 2007 08:38, Jesper Eskilson wrote:
...
> I've written a simple hack in Ruby which extracts the most vital parts of a
> .vcproj file and generates a corresponding CMakeLists.txt. There are a lot
> of things it doesn't handle (custom build steps, multiple configurations,
> etc.), but its a good starting point.
>
> Feel free to use it; but I make no guarantees. It shouldn't wipe your
> harddrive, though. I hope. ;-)

can you please put this converter or a link to it in the cmake wiki ?
It should go in this section:
http://www.cmake.org/Wiki/CMake#Converters_from_other_buildsystems_to_CMake

Thanks
Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] creating static library with references to other .lib files

2007-06-12 Thread Jesper Eskilson

2007/6/7, Jesper Eskilson <[EMAIL PROTECTED]>:




2007/6/7, Brandon Van Every <[EMAIL PROTECTED]>:
>
> On 6/7/07, Jesper Eskilson <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > I would like to be able to create a static library on Windows which
> > includes an import library to a DLL, so that users of the static
> > library do not need to specify the import library.
>
> By chance, is your library a C library that is commonly available to
> the public, i.e. is typically present in Linux or Cygwin distributions
> and whatnot?  If so, you have a problem that will likely sidestep the
> issue / render it moot.  Regardless of the choice of linkage, you
> could suffer a namespace collision between the version you're
> maintaining in your own code, and the publically available version.
> Segfaults etc.  Here's the issue in our bug tracker that we haven't
> resolved yet, it gives a lot of detail as to what kinds of things can
> go wrong.  http://trac.callcc.org/ticket/215


I think we have all our bases covered, but thanks anyway.



I'm still interested in a solution to my original problem, though.

--
/Jesper
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] how to automatically make object from generated source?

2007-06-12 Thread Mathieu Malaterre

On 6/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:





Hello,

thanks for the replies to my previous question. Here comes the next one.

I have got a couple of C and C++ sources with embedded SQL. These are
transformed into
real C and C++ sources with a preprocessor (Oracle proc). The resulting
sources should be
compiled with gcc with my ADD_DEFINITIONS and INCLUDE_DIRECTORIES settings.
The resulting object than must be linked with a custom command called
buildserver.

So what I'm trying now is

SET_SOURCE_FILES_PROPERTIES( ${src_dir}/admin/clean.cpp PROPERTIES
GENERATED true )

ADD_CUSTOM_COMMAND( OUTPUT ${src_dir}/admin/clean.cpp
COMMAND proc MODE=ANSI code=cpp
iname=${src_dir}/admin/clean.ec
oname=${src_dir}/admin/clean.cpp
DEPENDS ${src_dir}/admin/clean.ec )

ADD_CUSTOM_COMMAND( OUTPUT ${src_dir}/admin/clean
COMMAND buildserver -o ${src_dir}/admin/clean
  -f ${src_dir}/admin/clean.o
  DEPENDS ${src_dir}/admin/clean.o )

ADD_CUSTOM_TARGET( dummy ALL DEPENDS ${src_dir}/admin/clean )


I suggested dummy, but you should really use another name. Take for
instance the name of the executable, it will add a nicer target (more
representativ) in your makefile. As a


What I'm now getting is the following error message:

make[2]: *** No rule to make target `[...]/admin/clean.o', needed by
`[...]/admin/clean'.
Stop.

I thought about adding a custom command for this step (.cpp -> .o) but that
seems not so nice.
Is there a better way or am i missing something?

Regards
Jens-Michael



-

Diese E-Mail könnte  vertrauliche und/oder rechtlich geschützte
Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die
unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

--
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake




--
Mathieu
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] how to automatically make object from generated source?

2007-06-12 Thread Jens . M . Hoffmann




Hello,

thanks for the replies to my previous question. Here comes the next one.

I have got a couple of C and C++ sources with embedded SQL. These are
transformed into
real C and C++ sources with a preprocessor (Oracle proc). The resulting
sources should be
compiled with gcc with my ADD_DEFINITIONS and INCLUDE_DIRECTORIES settings.
The resulting object than must be linked with a custom command called
buildserver.

So what I'm trying now is

SET_SOURCE_FILES_PROPERTIES( ${src_dir}/admin/clean.cpp PROPERTIES
GENERATED true )

ADD_CUSTOM_COMMAND( OUTPUT ${src_dir}/admin/clean.cpp
COMMAND proc MODE=ANSI code=cpp
iname=${src_dir}/admin/clean.ec
oname=${src_dir}/admin/clean.cpp
DEPENDS ${src_dir}/admin/clean.ec )

ADD_CUSTOM_COMMAND( OUTPUT ${src_dir}/admin/clean
COMMAND buildserver -o ${src_dir}/admin/clean
  -f ${src_dir}/admin/clean.o
  DEPENDS ${src_dir}/admin/clean.o )

ADD_CUSTOM_TARGET( dummy ALL DEPENDS ${src_dir}/admin/clean )

What I'm now getting is the following error message:

make[2]: *** No rule to make target `[...]/admin/clean.o', needed by
`[...]/admin/clean'.
Stop.

I thought about adding a custom command for this step (.cpp -> .o) but that
seems not so nice.
Is there a better way or am i missing something?

Regards
Jens-Michael



-

Diese E-Mail könnte  vertrauliche und/oder rechtlich geschützte
Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die
unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

--___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] [Dev] CMake 2.5 tool chain support example

2007-06-12 Thread Alexander Neundorf
Hi,

On Monday 11 June 2007 18:15, Trevor Kellaway wrote:
> Alex,
>
> > Please update to current cvsand use "Generic" as
> > CMAKE_SYSTEM_NAME, there is now a Generic.cmake in cmake.
>
> I still think I should use vendor ("Freescale") instead of "Generic", as
> "Generic-chc12" may not be unique, it is just luck that two different
> vendors have differently named compilers, so using this as the
> discrimination just seems wrong (I've actually got three different
> compilers for the HC12).

In cvs HEAD there are two ways how the compiler file may be named:
either -.cmake
(which would give Generic-chc12.cmake)
and additionally 
-.cmake
where  is determined by compiling a small test program and 
encoding a compiler identification string in it, which could be 
e.g. "FreeScaleCHC12". This way the name would/will be unique.
(leaves the problem that it can't link by default).

...
> > And there is no way to have your compiler produce a linked
> > executable, e.g.
> > with some force or ignore flags or some default settings ?
> > (it doesn't have to actually be able to run on the target).
>
> The compiler flags aren't the issue, the link/locator needs a custom
> control file (see "link.prm" in the previous attachment), and defaulting
> this isn't possible without also including a copy, it is possible, but
> why bother? What benefit does the compiler test give?

Then many more of the tests in cmake just work and less manual tweaking is 
required.

Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Changing the include switch

2007-06-12 Thread John Donovan
We're using the Metrowerks compiler, and as you can imagine it's a little 
non-standard (or rather, non GCC). By default, the -I compiler switch adds a 
path to the project search paths, and -I- adds them to the system paths. Can 
I change the behaviour of CMake to accommodate this?
An alternative is to provide the -gccincludes switch to the compiler 
commandline _before_ the -I switches, but CMake puts the includes first, 
then the definitions and COMPILE_FLAGS property. If I can't change the 
switch to -I-, can I change the order in which switches get added?


John Donovan - Programmer, TT Fusion Ltd.



__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] cmake VS .net 2003 C++ properties missing

2007-06-12 Thread kennedy
We are using CMake 2.4.6 to manage multi platform builds: Linux and Win32 
(typically VS .net 2002). Using CMake, I recently generated a VS .net 2003 
solution for this code. When I try to examine the C++ properties for any 
of the VS .net 2003 projects, ... well, I find that  there are no C++ 
properties in any of the displayed VS .net 2003 projects. I verified that 
the C++ properties are there by examining the actual project files 
themselves: they simply are not displayed in VS .net 2003.

Is there something that I can do to correct this? Am I doing something 
wrong? In digging around, I have not seen anything that indicates I need 
to do anything different when generating a VS .net 2003 solution from 
CMake.

Thoughts?

Dave Kennedy



This is an e-mail from General Dynamics Land Systems. It is for the intended 
recipient only and may contain confidential and privileged information.  No one 
else may read, print, store, copy, forward or act in reliance on it or its 
attachments.  If you are not the intended recipient, please return this message 
to the sender and delete the message and any attachments from your computer. 
Your cooperation is appreciated.

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Add a flag to the resource compiler.

2007-06-12 Thread Wilco Schillemans

Hello,

I have written a small example project to illustrate the problem I am 
having with changing the command line options for the resource compiler.
Somehow the SET(CMAKE_COMPILE_RESOURCE "this should cause a build 
error") is not behaving the way I expect it to do.


Can someone spot the error?

I am using cmake 2.4 patch 6 and I build using Microsoft Visual Studio 
2005 Express Edition.


Kind regards,

Wilco


CMakeLists.txt:
-
PROJECT(resource_test)

ENABLE_LANGUAGE(RC)
SET(CMAKE_COMPILE_RESOURCE "this should cause a build error")


SET(SOURCES test.cpp)
IF(WIN32)
 SET(SOURCES ${SOURCES} test.rc)
ENDIF(WIN32)

ADD_EXECUTABLE(test ${SOURCES})
-

test.cpp:

#include 

-
int main(int argc, char* argv[])
{
 std::cout << "test" << std::endl;

 return 0;
}
-

and test.rc

-
#define LANG_ENGLISH   0x09
#define SUBLANG_ENGLISH_UK 0x02

LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK

#define VOS_NT_WINDOWS32 0x00040004L
#define VFT_APP  0x0001L
#define VS_FF_DEBUG  0x0001L

// Version Information
1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS VS_FF_DEBUG
#else
 FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
{
BLOCK "StringFileInfo"
{
 BLOCK "040904b0"
 {
  VALUE "CompanyName",  "test company"
  VALUE "FileDescription",  "test application"
  VALUE "FileVersion",  "1.0.0.0"
  VALUE "InternalName", "test.exe\0"
  VALUE "LegalCopyright",   "copyright"
  VALUE "LegalTrademarks",  ""
  VALUE "OriginalFilename", "test.exe\0"
  VALUE "ProductName",  "test\0"
  VALUE "ProductVersion",   "1.0.0.0"
#ifdef _DEBUG
  VALUE "Comments", "debug"
#else
  VALUE "Comments", "release"
#endif
 }
}
}
-




--
Wilco Schillemans
Erasmus MC - Daniel den Hoed Cancer Center
Department of Radiation Oncology
Groene Hilledijk 301
3075 EA Rotterdam
The Netherlands

Tel: +31 10 439 12 60
Fax: +31 10 439 10 12
E-mail: [EMAIL PROTECTED] 


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake